程序包 cool.scx.util

类 RandomUtils

java.lang.Object
cool.scx.util.RandomUtils

public final class RandomUtils extends Object
用于生成简单的随机数
版本:
0.0.1
作者:
scx567888
  • 构造器详细资料

    • RandomUtils

      public RandomUtils()
  • 方法详细资料

    • randomString

      public static String randomString(int size, boolean withLetter)
      获取随机的 Code 注意!!! 此方法和 getUUID 不同 若需要获取 uuid 请使用 getUUID
      参数:
      size - code 的长度
      withLetter - code 中是否包含字母
      返回:
      a String object
    • randomString

      public static String randomString(int size)
      获取随机的 Code (包含字母和数字)
      参数:
      size - code 的长度
      返回:
      a
    • randomNumber

      public static int randomNumber(int min, int max)
      取一个指定区间的随机数 (包含两端)
      参数:
      min - 最小值
      max - 最大值
      返回:
      随机数
    • randomUUID

      public static String randomUUID()
      获取UUID
      返回:
      a String object.