Class AnnotationRandomizerRegistry

java.lang.Object
org.jeasy.random.randomizers.registry.AnnotationRandomizerRegistry
All Implemented Interfaces:
RandomizerRegistry

public class AnnotationRandomizerRegistry extends Object implements RandomizerRegistry
A RandomizerRegistry for fields annotated with Randomizer.
Author:
Mahmoud Ben Hassine ([email protected])
  • Constructor Details

    • AnnotationRandomizerRegistry

      public AnnotationRandomizerRegistry()
  • Method Details

    • init

      public void init(EasyRandomParameters parameters)
      Description copied from interface: RandomizerRegistry
      Initialize the registry.
      Specified by:
      init in interface RandomizerRegistry
      Parameters:
      parameters - of the EasyRandom instance being configured
    • getRandomizer

      public Randomizer<?> getRandomizer(Field field)
      Retrieves a randomizer for the given field.
      Specified by:
      getRandomizer in interface RandomizerRegistry
      Parameters:
      field - the field for which a randomizer was registered
      Returns:
      the randomizer registered for the given field
    • getRandomizer

      public Randomizer<?> getRandomizer(Class<?> clazz)
      Retrieves a randomizer for a given type.
      Specified by:
      getRandomizer in interface RandomizerRegistry
      Parameters:
      clazz - the type for which a randomizer was registered
      Returns:
      the randomizer registered for the given type.