Package io.servicetalk.utils.internal
Class RandomUtils
java.lang.Object
io.servicetalk.utils.internal.RandomUtils
Internal random utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
nextLongInclusive
(long upperBound) Generate a random long between 0 and the upper bound, both inclusive.static long
nextLongInclusive
(long lowerBound, long upperBound) Generate a random long between the specified lower and upper bound, both inclusive.
-
Method Details
-
nextLongInclusive
public static long nextLongInclusive(long upperBound) Generate a random long between 0 and the upper bound, both inclusive.- Parameters:
upperBound
- the inclusive upper bound.- Returns:
- a random long between 0 and the upper bound, both inclusive.
-
nextLongInclusive
public static long nextLongInclusive(long lowerBound, long upperBound) Generate a random long between the specified lower and upper bound, both inclusive.- Parameters:
lowerBound
- the inclusive lower bound.upperBound
- the inclusive upper bound.- Returns:
- a random long between the specified lower and upper bound, both inclusive.
-