类 RandomUtils
java.lang.Object
com.alibaba.nacos.common.utils.RandomUtils
Random utils.
- 作者:
- zzq
-
方法概要
-
方法详细资料
-
nextLong
public static long nextLong(long startInclusive, long endExclusive) Returns a random long within the specified range.- 参数:
startInclusive- the smallest value that can be returned, must be non-negativeendExclusive- the upper bound (not included)- 返回:
- the random long
- 抛出:
IllegalArgumentException- if startInclusive or endExclusive illegal
-
nextInt
public static int nextInt(int startInclusive, int endExclusive) Returns a random integer within the specified range.- 参数:
startInclusive- lower limit, must be non-negativeendExclusive- the upper bound (not included)- 返回:
- the random integer
- 抛出:
IllegalArgumentException- if startInclusive or endExclusive illegal
-