Class KotlinDefaultMask
java.lang.Object
org.springframework.data.mapping.model.KotlinDefaultMask
Value object representing defaulting masks used for Kotlin methods applying parameter defaulting.
- Since:
- 2.1
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
forEach
(IntConsumer maskCallback) Callback method to notifyIntConsumer
for each defaulting mask.static KotlinDefaultMask
Creates defaulting mask(s) used to invoke Kotlin default methods that conditionally apply parameter values.int[]
static int
getMaskCount
(int arguments) Return the number of defaulting masks required to represent the number ofarguments
.
-
Method Details
-
forEach
Callback method to notifyIntConsumer
for each defaulting mask.- Parameters:
maskCallback
- must not be null.
-
getMaskCount
public static int getMaskCount(int arguments) Return the number of defaulting masks required to represent the number ofarguments
.- Parameters:
arguments
- number of method arguments.- Returns:
- the number of defaulting masks required. Returns at least one to be used with
copy
methods.
-
from
public static KotlinDefaultMask from(kotlin.reflect.KFunction<?> function, Predicate<kotlin.reflect.KParameter> isPresent) Creates defaulting mask(s) used to invoke Kotlin default methods that conditionally apply parameter values.- Parameters:
function
- theKFunction
that should be invoked.isPresent
-Predicate
for the presence/absence of parameters.- Returns:
KotlinDefaultMask
.
-
getDefaulting
public int[] getDefaulting()
-