Class OptionalRandomizer

    • 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
      T getRandomValue() Generate a random value for the given type.
      • 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

      • OptionalRandomizer

        OptionalRandomizer(Randomizer<T> delegate, int optionalPercent)
        Create a new OptionalRandomizer with a delegate randomizer and an optional percent threshold.
        Parameters:
        delegate - The delegate to use to retrieve a random value
        optionalPercent - The percent of randomized value to return (between 0 and 100)
    • Method Detail

      • getRandomValue

         T getRandomValue()

        Generate a random value for the given type.

        Returns:

        a random value for the given type