Class NumberRandomizers

java.lang.Object
io.github.cjstehno.testthings.rando.NumberRandomizers

public final class NumberRandomizers extends Object
A collection of randomizers for generating numbers.
  • Constructor Details

    • NumberRandomizers

      public NumberRandomizers()
  • Method Details

    • anIntBetween

      public static Randomizer<Integer> anIntBetween(int min, int max)
      Builds a randomizer which will generate a random int between the min (inclusive) and max (exclusive) bounds.
      Parameters:
      min - the min value (inclusive)
      max - the max value (exclusive)
      Returns:
      the randomizer
    • aLongBetween

      public static Randomizer<Long> aLongBetween(long min, long max)
      Builds a randomizer which will generate a random long between the min (inclusive) and max (exclusive) bounds.
      Parameters:
      min - the min value (inclusive)
      max - the max value (exclusive)
      Returns:
      the randomizer
    • aBigInteger

      public static Randomizer<BigInteger> aBigInteger()
      Builds a randomizer which will generate a random BigInteger.
      Returns:
      the randomizer
    • aBigDecimal

      public static Randomizer<BigDecimal> aBigDecimal()
      Builds a randomizer which will generate a random BigDecimal.
      Returns:
      the randomizer
    • aFloatBetween

      public static Randomizer<Float> aFloatBetween(float min, float max)
      Builds a randomizer which will generate a random float between the min (inclusive) and max (exclusive) bounds.
      Parameters:
      min - the min value (inclusive)
      max - the max value (exclusive)
      Returns:
      the randomizer
    • aDoubleBetween

      public static Randomizer<Double> aDoubleBetween(double min, double max)
      Builds a randomizer which will generate a random double between the min (inclusive) and max (exclusive) bounds.
      Parameters:
      min - the min value (inclusive)
      max - the max value (exclusive)
      Returns:
      the randomizer
    • aBoolean

      public static Randomizer<Boolean> aBoolean()
      A randomizer which will generate a random boolean value.
      Returns:
      the randomizer
    • anInt

      public static Randomizer<Integer> anInt()
      A randomizer which will generate a random int value.
      Returns:
      the randomizer
    • aShort

      public static Randomizer<Short> aShort()
      A randomizer which will generate a random short value.
      Returns:
      the randomizer
    • aLong

      public static Randomizer<Long> aLong()
      A randomizer which will generate a random long value.
      Returns:
      the randomizer
    • aDouble

      public static Randomizer<Double> aDouble()
      A randomizer which will generate a random double value.
      Returns:
      the randomizer
    • aFloat

      public static Randomizer<Float> aFloat()
      A randomizer which will generate a random float value.
      Returns:
      the randomizer
    • aByte

      public static Randomizer<Byte> aByte()
      A randomizer which will generate a random byte value.
      Returns:
      the randomizer
    • byteArray

      public static Randomizer<byte[]> byteArray(int length)
      A randomizer which will generate a random byte array value.
      Parameters:
      length - the length of the byte array
      Returns:
      the randomizer