Class EnumRandomizer

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      E getRandomValue() Get a random value within an enumeration or an enumeration subset (when values are excluded)
      • Methods inherited from class io.github.krandom.randomizers.AbstractRandomizer

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EnumRandomizer

        EnumRandomizer(Class<E> enumeration)
        Create a new EnumRandomizer.
        Parameters:
        enumeration - the enumeration from which this randomizer will generate random values
      • EnumRandomizer

        EnumRandomizer(Class<E> enumeration, long seed)
        Create a new EnumRandomizer.
        Parameters:
        enumeration - the enumeration from which this randomizer will generate random values
        seed - the initial seed
      • EnumRandomizer

        EnumRandomizer(Class<E> enumeration, Array<E> excludedValues)
        Create a new EnumRandomizer.
        Parameters:
        enumeration - the enumeration from which this randomizer will generate random values
        excludedValues - the values to exclude from random picking
      • EnumRandomizer

        EnumRandomizer(Class<E> enumeration, long seed, Array<E> excludedValues)
        Create a new EnumRandomizer.
        Parameters:
        enumeration - the enumeration from which this randomizer will generate random values
        seed - the initial seed
        excludedValues - the values to exclude from random picking
    • Method Detail

      • getRandomValue

         E getRandomValue()

        Get a random value within an enumeration or an enumeration subset (when values are excluded)

        Returns:

        a random value within the enumeration