Package org.jeasy.random.api
Interface RandomizerContext
-
public interface RandomizerContext
A context object for aRandomizer
. This interface provides information about the randomization context.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getCurrentField()
Return the full path to the current field being randomized (starting from the first field in the root type).java.lang.Object
getCurrentObject()
Return the currently randomized object in the object graph.int
getCurrentRandomizationDepth()
Get the current level in the hierarchy of the object graph.EasyRandomParameters
getParameters()
Return the currently used parameters by the enclosingEasyRandom
.java.lang.Object
getRootObject()
Return the root object being randomized (instance ofgetTargetType()
.java.lang.Class<?>
getTargetType()
Return the target type (parameter ofEasyRandom.nextObject(Class)
).
-
-
-
Method Detail
-
getTargetType
java.lang.Class<?> getTargetType()
Return the target type (parameter ofEasyRandom.nextObject(Class)
).- Returns:
- target type
-
getRootObject
java.lang.Object getRootObject()
Return the root object being randomized (instance ofgetTargetType()
.- Returns:
- root object being randomized
-
getCurrentObject
java.lang.Object getCurrentObject()
Return the currently randomized object in the object graph.- Returns:
- currently randomized object
-
getCurrentField
java.lang.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
EasyRandomParameters getParameters()
Return the currently used parameters by the enclosingEasyRandom
.- Returns:
- currently used parameters
-
-