Class 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)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean shouldBeExcluded​(java.lang.Class<?> type, RandomizerContext context)
      Given the current randomization context, should the type be excluded from being populated ?
      boolean shouldBeExcluded​(java.lang.reflect.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
    • Constructor Detail

      • DefaultExclusionPolicy

        public DefaultExclusionPolicy()
    • 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:
        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​(java.lang.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