Package org.jeasy.random
Class DefaultExclusionPolicy
java.lang.Object
org.jeasy.random.DefaultExclusionPolicy
- All Implemented Interfaces:
ExclusionPolicy
Component that encapsulates the logic of field/type exclusion in a given randomization context.
This class implements exclusion rules in the predefined order.
- Author:
- Mahmoud Ben Hassine ([email protected])
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
shouldBeExcluded
(Class<?> type, RandomizerContext context) Given the current randomization context, should the type be excluded from being populated ?boolean
shouldBeExcluded
(Field field, RandomizerContext context) Given the current randomization context, should the field be excluded from being populated ?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jeasy.random.api.ExclusionPolicy
shouldBeExcluded
-
Constructor Details
-
DefaultExclusionPolicy
public DefaultExclusionPolicy()
-
-
Method Details
-
shouldBeExcluded
Given the current randomization context, should the field be excluded from being populated ?- Specified by:
shouldBeExcluded
in interfaceExclusionPolicy
- Parameters:
field
- the field to checkcontext
- the current randomization context- Returns:
- true if the field should be excluded, false otherwise
-
shouldBeExcluded
Given the current randomization context, should the type be excluded from being populated ?- Specified by:
shouldBeExcluded
in interfaceExclusionPolicy
- Parameters:
type
- the type to checkcontext
- the current randomization context- Returns:
- true if the type should be excluded, false otherwise
-