Package com.linkedin.venice.utils
Class RandomGenUtils
java.lang.Object
com.linkedin.venice.utils.RandomGenUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getRandomBytes
(int length) Generate an array of random bytesstatic float
static int
getRandomIntInRange
(int min, int max) static int
getRandomIntWithin
(int limit) Return a random integer between 0 and limit (exclusive)
-
Constructor Details
-
RandomGenUtils
public RandomGenUtils()
-
-
Method Details
-
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 Valuemax
- Maximum value. max must be greater than min.- Returns:
- Integer between min and max, inclusive.
-