Class RandomGenUtils


  • public class RandomGenUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      RandomGenUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] getRandomBytes​(int length)
      Generate an array of random bytes
      static float getRandomFloat()  
      static int getRandomIntInRange​(int min, int max)  
      static int getRandomIntWithin​(int limit)
      Return a random integer between 0 and limit (exclusive)
      • Methods inherited from class java.lang.Object

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

      • RandomGenUtils

        public RandomGenUtils()
    • Method Detail

      • getRandomBytes

        public static byte[] getRandomBytes​(int length)
        Generate an array of random bytes
        Parameters:
        length - length of the byte array to be generated
        Returns:
      • getRandomFloat

        public static float getRandomFloat()
        Returns:
        a random float
      • getRandomIntWithin

        public static int getRandomIntWithin​(int limit)
        Return a random integer between 0 and limit (exclusive)
        Parameters:
        limit - The upper bound for the range of numbers
        Returns:
      • getRandomIntInRange

        public static int getRandomIntInRange​(int min,
                                              int max)
        Parameters:
        min - Minimum Value
        max - Maximum value. max must be greater than min.
        Returns:
        Integer between min and max, inclusive.