Package org.jeasy.random
Class DefaultExclusionPolicy
- java.lang.Object
-
- org.jeasy.random.DefaultExclusionPolicy
-
- All Implemented Interfaces:
ExclusionPolicy
public class DefaultExclusionPolicy extends java.lang.Object implements 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 (mahmoud.benhassine@icloud.com)
-
-
Constructor Summary
Constructors Constructor Description DefaultExclusionPolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanshouldBeExcluded(java.lang.Class<?> type, RandomizerContext context)Given the current randomization context, should the type be excluded from being populated ?booleanshouldBeExcluded(java.lang.reflect.Field field, RandomizerContext context)Given the current randomization context, should the field be excluded from being populated ?
-
-
-
Method Detail
-
shouldBeExcluded
public boolean shouldBeExcluded(java.lang.reflect.Field field, RandomizerContext context)Given the current randomization context, should the field be excluded from being populated ?- Specified by:
shouldBeExcludedin interfaceExclusionPolicy- Parameters:
field- the field to checkcontext- the current randomization context- Returns:
- true if the field should be excluded, false otherwise
-
shouldBeExcluded
public boolean shouldBeExcluded(java.lang.Class<?> type, RandomizerContext context)Given the current randomization context, should the type be excluded from being populated ?- Specified by:
shouldBeExcludedin interfaceExclusionPolicy- Parameters:
type- the type to checkcontext- the current randomization context- Returns:
- true if the type should be excluded, false otherwise
-
-