程序包 cool.scx.util
类 RandomUtils
java.lang.Object
cool.scx.util.RandomUtils
用于生成简单的随机数
- 版本:
- 0.0.1
- 作者:
- scx567888
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static intrandomNumber(int min, int max) 取一个指定区间的随机数 (包含两端)static StringrandomString(int size) 获取随机的 Code (包含字母和数字)static StringrandomString(int size, boolean withLetter) 获取随机的 Code 注意!!!static String获取UUID
-
构造器详细资料
-
RandomUtils
public RandomUtils()
-
-
方法详细资料
-
randomString
获取随机的 Code 注意!!! 此方法和 getUUID 不同 若需要获取 uuid 请使用 getUUID- 参数:
size- code 的长度withLetter- code 中是否包含字母- 返回:
- a
Stringobject
-
randomString
获取随机的 Code (包含字母和数字)- 参数:
size- code 的长度- 返回:
- a
-
randomNumber
public static int randomNumber(int min, int max) 取一个指定区间的随机数 (包含两端)- 参数:
min- 最小值max- 最大值- 返回:
- 随机数
-
randomUUID
获取UUID- 返回:
- a
Stringobject.
-