Package org.catools.common.utils
Class CRandomUtil.Int
- java.lang.Object
-
- org.catools.common.utils.CRandomUtil.Int
-
- Enclosing class:
- CRandomUtil
public static class CRandomUtil.Int extends java.lang.Object
Random generator functions to generate random Integer values.
-
-
Constructor Summary
Constructors Constructor Description Int()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getNext()
Returns a random int within 0 - Integer.MAX_VALUEstatic int
getNext(int startInclusive, int endExclusive)
Returns a random integer within the specified range.
-
-
-
Method Detail
-
getNext
public static int getNext(int startInclusive, int endExclusive)
Returns a random integer within the specified range.
- Parameters:
startInclusive
- the smallest value that can be returned, must be non-negativeendExclusive
- the upper bound (not included)- Returns:
- the random integer
- Throws:
java.lang.IllegalArgumentException
- ifstartInclusive > endExclusive
or ifstartInclusive
is negative
-
getNext
public static int getNext()
Returns a random int within 0 - Integer.MAX_VALUE
- Returns:
- the random integer
- See Also:
getNext(int, int)
-
-