Package io.github.krandom.api
Interface RandomizerContext
public interface RandomizerContext
A context object for a
Randomizer
. This interface provides information about the
randomization context.-
Method Summary
Modifier and TypeMethodDescriptionReturn the full path to the current field being randomized (starting from the first field in the root type).Return the currently randomized object in the object graph.int
Get the current level in the hierarchy of the object graph.Return the currently used parameters by the enclosingKRandom
.Return the root object being randomized (instance ofgetTargetType()
.Class<?>
Return the target type (parameter ofKRandom.nextObject(Class)
).
-
Method Details
-
getTargetType
Class<?> getTargetType()Return the target type (parameter ofKRandom.nextObject(Class)
).- Returns:
- target type
-
getRootObject
Object getRootObject()Return the root object being randomized (instance ofgetTargetType()
.- Returns:
- root object being randomized
-
getCurrentObject
Object getCurrentObject()Return the currently randomized object in the object graph.- Returns:
- currently randomized object
-
getCurrentField
String getCurrentField()Return the full path to the current field being randomized (starting from the first field in the root type).- Returns:
- full path to the current field being randomized
-
getCurrentRandomizationDepth
int getCurrentRandomizationDepth()Get the current level in the hierarchy of the object graph.- Returns:
- current level in the hierarchy of the object graph.
-
getParameters
KRandomParameters getParameters()Return the currently used parameters by the enclosingKRandom
.- Returns:
- currently used parameters
-