This commit is contained in:
Redkale
2018-05-17 17:06:57 +08:00
parent 1f8884a415
commit b13b07fb05

View File

@@ -137,6 +137,17 @@ public final class Utility {
private Utility() {
}
/**
* 创建随机源
*
* @return SecureRandom
*/
public static SecureRandom createRandom() {
SecureRandom random = new SecureRandom();
random.setSeed(System.nanoTime());
return random;
}
/**
* 将多个key:value的字符串键值对组合成一个Mapitems长度必须是偶数, 参数个数若是奇数的话,最后一个会被忽略
* 类似 JDK9中的 Map.of 方法