类 RandomUtils
java.lang.Object
spring.turbo.util.RandomUtils
随机数生成工具
- 从以下版本开始:
- 1.0.0
- 作者:
- 应卓
- 另请参阅:
-
方法概要
修饰符和类型方法说明static boolean随机生成布尔值static byte[]nextBytes(int count) 随机生成字节数组static double随机生成双精度数static doublenextDouble(double startInclusive, double endExclusive) 随机生成双精度数static float随机生成浮点数数static floatnextFloat(float startInclusive, float endExclusive) 随机生成浮点数数static intnextInt()随机生成整数static intnextInt(int startInclusive, int endExclusive) 随机生成整数static longnextLong()随机生成长整数static longnextLong(long startInclusive, long endExclusive) 随机生成长整数
-
方法详细资料
-
nextBoolean
public static boolean nextBoolean()随机生成布尔值- 返回:
- 随机布尔值
-
nextBytes
public static byte[] nextBytes(int count) 随机生成字节数组- 参数:
count- 字符数组长度- 返回:
- 随机字节数组
-
nextInt
public static int nextInt(int startInclusive, int endExclusive) 随机生成整数- 参数:
startInclusive- 开始 (包含)endExclusive- 结束 (不包含)- 返回:
- 随机整数
-
nextInt
public static int nextInt()随机生成整数- 返回:
- 随机整数
-
nextLong
public static long nextLong(long startInclusive, long endExclusive) 随机生成长整数- 参数:
startInclusive- 开始 (包含)endExclusive- 结束 (不包含)- 返回:
- 随机长整数
-
nextLong
public static long nextLong()随机生成长整数- 返回:
- 随机长整数
-
nextDouble
public static double nextDouble(double startInclusive, double endExclusive) 随机生成双精度数- 参数:
startInclusive- 开始 (包含)endExclusive- 结束 (不包含)- 返回:
- 随机双精度数
-
nextDouble
public static double nextDouble()随机生成双精度数- 返回:
- 随机双精度数
-
nextFloat
public static float nextFloat(float startInclusive, float endExclusive) 随机生成浮点数数- 参数:
startInclusive- 开始 (包含)endExclusive- 结束 (不包含)- 返回:
- 随机浮点数
-
nextFloat
public static float nextFloat()随机生成浮点数数- 返回:
- 随机浮点数
-