Class DefaultExclusionPolicy

java.lang.Object
org.jeasy.random.DefaultExclusionPolicy
All Implemented Interfaces:
ExclusionPolicy

public class DefaultExclusionPolicy extends 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 ([email protected])
  • Constructor Details

    • DefaultExclusionPolicy

      public DefaultExclusionPolicy()
  • Method Details

    • shouldBeExcluded

      public boolean shouldBeExcluded(Field field, RandomizerContext context)
      Given the current randomization context, should the field be excluded from being populated ?
      Specified by:
      shouldBeExcluded in interface ExclusionPolicy
      Parameters:
      field - the field to check
      context - the current randomization context
      Returns:
      true if the field should be excluded, false otherwise
    • shouldBeExcluded

      public boolean shouldBeExcluded(Class<?> type, RandomizerContext context)
      Given the current randomization context, should the type be excluded from being populated ?
      Specified by:
      shouldBeExcluded in interface ExclusionPolicy
      Parameters:
      type - the type to check
      context - the current randomization context
      Returns:
      true if the type should be excluded, false otherwise