Class RandomNumberExtensions


  • public final class RandomNumberExtensions
    extends java.lang.Object
    Utility class for producing random numbers.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigDecimal getRandomBigDecimal​(int afterComma, int beforeComma)
      The Method getRandomBigDecimal(int,int) gets an random BigDecimal.
      static java.lang.String getRandomFloatString​(int afterComma, int beforeComma)
      Gets the random float string.
      static java.lang.String getRandomNumericString()
      Generates a random numeric string.
      static java.lang.String getRandomNumericString​(int length)
      The Method getRandomNumericString(int) produces a random Number to the specified length.
      static java.math.BigDecimal randomBigDecimal()
      Generates a random BigDecimal
      static java.math.BigInteger randomBigInteger()
      Generates a random BigInteger
      • Methods inherited from class java.lang.Object

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

      • getRandomBigDecimal

        public static java.math.BigDecimal getRandomBigDecimal​(int afterComma,
                                                               int beforeComma)
        The Method getRandomBigDecimal(int,int) gets an random BigDecimal.
        Parameters:
        afterComma - How many decimal places after the comma.
        beforeComma - How many decimal places before the comma.
        Returns:
        The produced BigDecimal.
      • getRandomFloatString

        public static java.lang.String getRandomFloatString​(int afterComma,
                                                            int beforeComma)
        Gets the random float string.
        Parameters:
        afterComma - How many decimal places after the comma.
        beforeComma - How many decimal places before the comma.
        Returns:
        the random float string
      • getRandomNumericString

        public static java.lang.String getRandomNumericString()
        Generates a random numeric string.
        Returns:
        the generated random numeric string.
      • getRandomNumericString

        public static java.lang.String getRandomNumericString​(int length)
        The Method getRandomNumericString(int) produces a random Number to the specified length.
        Parameters:
        length - The length from the random number.
        Returns:
        The random number as String.
      • randomBigDecimal

        public static java.math.BigDecimal randomBigDecimal()
        Generates a random BigDecimal
        Returns:
        the random BigDecimal
      • randomBigInteger

        public static java.math.BigInteger randomBigInteger()
        Generates a random BigInteger
        Returns:
        the random BigInteger