Class EnumSetRandomizer<E extends Enum<E>>

java.lang.Object
org.jeasy.random.randomizers.collection.EnumSetRandomizer<E>
Type Parameters:
E - type of elements to generate
All Implemented Interfaces:
Randomizer<Collection<E>>

public class EnumSetRandomizer<E extends Enum<E>> extends Object
A Randomizer that generates an EnumSet of random enum values using a delegate EnumRandomizer.
Author:
Mahmoud Ben Hassine ([email protected])
  • Constructor Details

    • EnumSetRandomizer

      public EnumSetRandomizer(EnumRandomizer<E> delegate)
      Create a new EnumSetRandomizer that will generate an EnumSet with a random number of elements.
      Parameters:
      delegate - the EnumRandomizer used to generate random elements
    • EnumSetRandomizer

      public EnumSetRandomizer(EnumRandomizer<E> delegate, int nbElements)
      Create a new EnumSetRandomizer that will generate an EnumSet with a fixed number of elements.
      Parameters:
      delegate - the EnumRandomizer used to generate random elements
      nbElements - The number of elements to generate
  • Method Details

    • getRandomValue

      public EnumSet<E> getRandomValue()
      Description copied from interface: Randomizer
      Generate a random value for the given type.
      Returns:
      a random value for the given type
    • toString

      public String toString()
      Overrides:
      toString in class Object