Class AnyOfValueGenerator

java.lang.Object
nl._42.beanie.generator.random.AnyOfValueGenerator
All Implemented Interfaces:
ValueGenerator

public class AnyOfValueGenerator extends Object implements ValueGenerator
Retrieves a random value from an array of possibilities.
Since:
Feb 14, 2014
Author:
Sander Benschip
  • Constructor Details

    • AnyOfValueGenerator

      public AnyOfValueGenerator(Object[] values)
  • Method Details

    • generate

      public Object generate(Class<?> valueType)
      Description copied from interface: ValueGenerator
      Generate a new value of the specified type.
      Specified by:
      generate in interface ValueGenerator
      Parameters:
      valueType - the type of value
      Returns:
      the generation value
    • randomInt

      public int randomInt(int n)
    • randomBoolean

      public boolean randomBoolean(double d)
    • randomInt

      public int randomInt(int minimum, int maximum)
    • randomLong

      public long randomLong(int maximum)
    • randomLong

      public long randomLong(int minimum, int maximum)
    • randomDouble

      public double randomDouble()
    • randomDouble

      public double randomDouble(double maximum)
    • randomBigDecimal

      public BigDecimal randomBigDecimal()
    • randomBigDecimal

      public BigDecimal randomBigDecimal(double maximum)