Interface RandomizerProvider

  • All Implemented Interfaces:

    
    public interface RandomizerProvider
    
                        

    Strategy interface to provide randomizers for field/type based on the current context. Implementations may (or may not) use registries to provide randomizers.

    The added value of this interface compared to a simple RandomizerRegistry is that it gives access to the current context and allows fine grained randomizer selection based on that context.

    Author:

    Mahmoud Ben Hassine ([email protected])

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getRandomizerByField

         Randomizer<?> getRandomizerByField(Field field, RandomizerContext context)

        Return a randomizer for the given field in the current context.

        Parameters:
        field - for which a randomizer should be returned
        context - current randomization context
        Returns:

        a randomizer for the given field in the current context.

      • getRandomizerByType

         <T extends Any> Randomizer<T> getRandomizerByType(Class<T> type, RandomizerContext context)

        Return a randomizer for the given type in the current context.

        Parameters:
        type - for which a randomizer should be returned
        context - current randomization context
        Returns:

        a randomizer for the given type in the current context. </T>