Class RandomPrimitivesFactory


  • public final class RandomPrimitivesFactory
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean randomBoolean​(java.security.SecureRandom secureRandom)
      Returns a random boolean.
      static byte randomByte​(java.security.SecureRandom secureRandom)
      The Method randomByte() selects a random byte.
      static byte[] randomByteArray​(int length, java.security.SecureRandom secureRandom)
      The Method randomByteArray(int) generates a random byte array.
      static char randomChar​(java.security.SecureRandom secureRandom)
      Returns a random char.
      static double randomDouble​(double range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)
      Gets an random double to the given range with the given random algorithm

      For example: if you put range to 10 the random float is between 0.0-9.9
      static double randomDouble​(double range, java.security.SecureRandom secureRandom)
      Gets an random double to the given range with the given random algorithm

      For example: if you put range to 10 the random float is between 0.0-9.9
      static double randomDouble​(java.security.SecureRandom secureRandom)
      Gets an random double to the given range with the given random algorithm

      For example: if you put range to 10 the random float is between 0.0-9.9
      static double randomDoubleBetween​(double start, double end, java.security.SecureRandom secureRandom)
      Gets the random double between the range from start and end.
      static float randomFloat​(float range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)
      Gets an random float to the given range with the given random algorithm

      For example: if you put range to 10 the random float is between 0.0-9.9
      static float randomFloat​(float range, java.security.SecureRandom secureRandom)
      Gets an random float to the given range with the given random algorithm

      For example: if you put range to 10 the random float is between 0.0-9.9
      static float randomFloat​(java.security.SecureRandom secureRandom)
      Generates a random float between the range 0.0-9.9.
      static float randomFloatBetween​(float start, float end, java.security.SecureRandom secureRandom)
      Gets the random float between the range from start and end.
      static int randomInt​(int range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)
      The Method randomInt(int) gets an int to the spezified range.
      static int randomInt​(int range, java.security.SecureRandom secureRandom)
      The Method randomInt(int) gets an int to the spezified range.
      static int randomInt​(java.security.SecureRandom secureRandom)
      The Method randomInt() gets an int between the range 0-9.
      static int randomIntBetween​(int minVolume, int maxVolume, java.security.SecureRandom secureRandom)
      Returns a random int between the range from minVolume and maxVolume with the Math.abs method.
      static long randomLong​(long range, de.alpharogroup.random.enums.RandomAlgorithm algorithm, java.security.SecureRandom secureRandom)
      Gets an random long to the given range with the given random algorithm

      For example: if you put range to 10 the random int is between 0-9
      static long randomLong​(long range, java.security.SecureRandom secureRandom)
      Gets an random long to the given range with the given random algorithm

      For example: if you put range to 10 the random int is between 0-9
      static long randomLong​(java.security.SecureRandom secureRandom)
      Gets a random long
      static long randomLongBetween​(long start, long end, java.security.SecureRandom secureRandom)
      Returns a random long between the range from start and end.
      static short randomShort​(java.security.SecureRandom secureRandom)
      Returns a random short
      • Methods inherited from class java.lang.Object

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

      • randomBoolean

        public static boolean randomBoolean​(java.security.SecureRandom secureRandom)
        Returns a random boolean.
        Parameters:
        secureRandom - the secure random for boolean generation
        Returns:
        The random boolean.
      • randomByte

        public static byte randomByte​(java.security.SecureRandom secureRandom)
        The Method randomByte() selects a random byte.
        Parameters:
        secureRandom - the secure random for byte generation
        Returns:
        The random byte.
      • randomByteArray

        public static byte[] randomByteArray​(int length,
                                             java.security.SecureRandom secureRandom)
        The Method randomByteArray(int) generates a random byte array.
        Parameters:
        length - the length
        secureRandom - the secure random for byte generation
        Returns:
        the byte[]
      • randomChar

        public static char randomChar​(java.security.SecureRandom secureRandom)
        Returns a random char.
        Parameters:
        secureRandom - the secure random for char generation
        Returns:
        The generated random char.
      • randomDouble

        public static double randomDouble​(double range,
                                          de.alpharogroup.random.enums.RandomAlgorithm algorithm,
                                          java.security.SecureRandom secureRandom)
        Gets an random double to the given range with the given random algorithm

        For example: if you put range to 10 the random float is between 0.0-9.9
        Parameters:
        range - the range
        algorithm - the random algorithm
        secureRandom - the secure random for double generation
        Returns:
        an random double not greater then the range
      • randomDouble

        public static double randomDouble​(double range,
                                          java.security.SecureRandom secureRandom)
        Gets an random double to the given range with the given random algorithm

        For example: if you put range to 10 the random float is between 0.0-9.9
        Parameters:
        range - the range
        secureRandom - the secure random for double generation
        Returns:
        an random double not greater then the range
      • randomDouble

        public static double randomDouble​(java.security.SecureRandom secureRandom)
        Gets an random double to the given range with the given random algorithm

        For example: if you put range to 10 the random float is between 0.0-9.9
        Parameters:
        secureRandom - the secure random for double generation
        Returns:
        an random double not greater then the range
      • randomDoubleBetween

        public static double randomDoubleBetween​(double start,
                                                 double end,
                                                 java.security.SecureRandom secureRandom)
        Gets the random double between the range from start and end.
        Parameters:
        start - the start
        end - the end
        secureRandom - the secure random for double generation
        Returns:
        the random double between
      • randomFloat

        public static float randomFloat​(float range,
                                        de.alpharogroup.random.enums.RandomAlgorithm algorithm,
                                        java.security.SecureRandom secureRandom)
        Gets an random float to the given range with the given random algorithm

        For example: if you put range to 10 the random float is between 0.0-9.9
        Parameters:
        range - the range
        algorithm - the random algorithm
        secureRandom - the secure random for float generation
        Returns:
        an random float not greater then the range
      • randomFloat

        public static float randomFloat​(float range,
                                        java.security.SecureRandom secureRandom)
        Gets an random float to the given range with the given random algorithm

        For example: if you put range to 10 the random float is between 0.0-9.9
        Parameters:
        range - the range
        secureRandom - the secure random for float generation
        Returns:
        an random float not greater then the range
      • randomFloat

        public static float randomFloat​(java.security.SecureRandom secureRandom)
        Generates a random float between the range 0.0-9.9.
        Parameters:
        secureRandom - the secure random for float generation
        Returns:
        the generated random float between the range 0.0-9.9.
      • randomFloatBetween

        public static float randomFloatBetween​(float start,
                                               float end,
                                               java.security.SecureRandom secureRandom)
        Gets the random float between the range from start and end.
        Parameters:
        start - the start
        end - the end
        secureRandom - the secure random for float generation
        Returns:
        the random float between
      • randomInt

        public static int randomInt​(int range,
                                    de.alpharogroup.random.enums.RandomAlgorithm algorithm,
                                    java.security.SecureRandom secureRandom)
        The Method randomInt(int) gets an int to the spezified range. For example: if you put range to 10 the random int is between 0-9.
        Parameters:
        range - The range
        algorithm - the random algorithm
        secureRandom - the secure random for int generation
        Returns:
        an int not greater then the range
      • randomInt

        public static int randomInt​(int range,
                                    java.security.SecureRandom secureRandom)
        The Method randomInt(int) gets an int to the spezified range. For example: if you put range to 10 the random int is between 0-9.
        Parameters:
        range - The Range
        secureRandom - the secure random for int generation
        Returns:
        an int not greater then the range.
      • randomInt

        public static int randomInt​(java.security.SecureRandom secureRandom)
        The Method randomInt() gets an int between the range 0-9.
        Parameters:
        secureRandom - the secure random for int generation
        Returns:
        an int between the range 0-9.
      • randomIntBetween

        public static int randomIntBetween​(int minVolume,
                                           int maxVolume,
                                           java.security.SecureRandom secureRandom)
        Returns a random int between the range from minVolume and maxVolume with the Math.abs method.
        Parameters:
        minVolume - the min volume
        maxVolume - the max volume
        secureRandom - the secure random for number generation
        Returns:
        A random int between the range from minVolume and maxVolume
      • randomLong

        public static long randomLong​(long range,
                                      de.alpharogroup.random.enums.RandomAlgorithm algorithm,
                                      java.security.SecureRandom secureRandom)
        Gets an random long to the given range with the given random algorithm

        For example: if you put range to 10 the random int is between 0-9
        Parameters:
        range - the range
        algorithm - the random algorithm
        secureRandom - the secure random for long generation
        Returns:
        an random long not greater then the range
      • randomLong

        public static long randomLong​(long range,
                                      java.security.SecureRandom secureRandom)
        Gets an random long to the given range with the given random algorithm

        For example: if you put range to 10 the random int is between 0-9
        Parameters:
        range - the range
        secureRandom - the secure random for long generation
        Returns:
        an random long not greater then the range
      • randomLong

        public static long randomLong​(java.security.SecureRandom secureRandom)
        Gets a random long
        Parameters:
        secureRandom - the secure random for long generation
        Returns:
        a random long
      • randomLongBetween

        public static long randomLongBetween​(long start,
                                             long end,
                                             java.security.SecureRandom secureRandom)
        Returns a random long between the range from start and end.
        Parameters:
        start - The long from where the range starts.
        end - The long from where the range ends.
        secureRandom - the secure random for long generation
        Returns:
        A random long between the range from start and end.
      • randomShort

        public static short randomShort​(java.security.SecureRandom secureRandom)
        Returns a random short
        Parameters:
        secureRandom - the secure random for short generation
        Returns:
        The generated random short