类 RandomStringUtils

java.lang.Object
spring.turbo.util.RandomStringUtils

public final class RandomStringUtils extends Object
随机字符串生成工具
从以下版本开始:
1.0.0
作者:
应卓
另请参阅:
  • 方法详细资料

    • random

      public static String random(int count)
      生成随机字符串
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomAscii

      public static String randomAscii(int count)
      生成随机字符串 (只包含ascii)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomAscii

      public static String randomAscii(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含ascii)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • randomAlphabetic

      public static String randomAlphabetic(int count)
      生成随机字符串 (只包含字母)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomAlphabetic

      public static String randomAlphabetic(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含字母)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • randomAlphanumeric

      public static String randomAlphanumeric(int count)
      生成随机字符串 (只包含字母和数字)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomAlphanumeric

      public static String randomAlphanumeric(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含字母和数字)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • randomGraph

      public static String randomGraph(int count)
      生成随机字符串 (只包含图形支付)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomGraph

      public static String randomGraph(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含图形支付)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • randomNumeric

      public static String randomNumeric(int count)
      生成随机字符串 (只包含数字)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomNumeric

      public static String randomNumeric(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含数字)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • randomPrint

      public static String randomPrint(int count)
      生成随机字符串 (只包含可显示字符)
      参数:
      count - 字符串长度
      返回:
      随机字符串
    • randomPrint

      public static String randomPrint(int minLengthInclusive, int maxLengthExclusive)
      生成随机字符串 (只包含可显示字符)
      参数:
      minLengthInclusive - 可能的长度最小值 (包含)
      maxLengthExclusive - 可能的长度最大值 (不包含)
      返回:
      随机字符串
    • random

      public static String random(int count, boolean letters, boolean numbers)
      生成随机字符串
      参数:
      count - 字符串长度
      letters - 是否可包含字母
      numbers - 是否可包含数字
      返回:
      随机字符串
    • random

      public static String random(int count, int start, int end, boolean letters, boolean numbers)
      生成随机字符串
      参数:
      count - 字符串长度
      start - 开始字符
      end - 结束字符
      letters - 是否可包含字母
      numbers - 是否可包含数字
      返回:
      随机字符串
    • random

      public static String random(int count, @Nullable String chars)
      生成随机字符串
      参数:
      count - 随机字符串长度
      chars - 随机字符串的可能的字符从此参数中获得
      返回:
      随机字符串
    • random

      public static String random(int count, @Nullable char... chars)
      生成随机字符串
      参数:
      count - 随机字符串长度
      chars - 随机字符串的可能的字符从此参数中获得
      返回:
      随机字符串
    • randomUUID

      public static String randomUUID()
      生成随机UUID字符串
      返回:
      随机UUID字符串
    • randomUUID

      public static String randomUUID(boolean removeHyphen)
      生成随机UUID字符串
      参数:
      removeHyphen - 结果中是否要移除字符"-"
      返回:
      随机UUID字符串