类 RandomUtils

java.lang.Object
spring.turbo.util.RandomUtils

public final class RandomUtils extends Object
随机数生成工具
从以下版本开始:
1.0.0
作者:
应卓
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    static boolean
    随机生成布尔值
    static byte[]
    nextBytes(int count)
    随机生成字节数组
    static double
    随机生成双精度数
    static double
    nextDouble(double startInclusive, double endExclusive)
    随机生成双精度数
    static float
    随机生成浮点数数
    static float
    nextFloat(float startInclusive, float endExclusive)
    随机生成浮点数数
    static int
    随机生成整数
    static int
    nextInt(int startInclusive, int endExclusive)
    随机生成整数
    static long
    随机生成长整数
    static long
    nextLong(long startInclusive, long endExclusive)
    随机生成长整数

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • 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()
      随机生成浮点数数
      返回:
      随机浮点数