Class RandomIntegerGenerator

  • All Implemented Interfaces:
    ValueGenerator

    public class RandomIntegerGenerator
    extends Object
    implements ValueGenerator
    Generates a random integer between the specified minimum and maximum range.
    Since:
    Feb 14, 2014
    Author:
    Sander Benschop
    • Constructor Detail

      • RandomIntegerGenerator

        public RandomIntegerGenerator​(int minimum,
                                      int maximum)
    • Method Detail

      • generate

        public Integer generate​(Class<?> type)
        Description copied from interface: ValueGenerator
        Generate a new value of the specified type.
        Specified by:
        generate in interface ValueGenerator
        Parameters:
        type - 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)