Class RandomUtils

java.lang.Object
io.servicetalk.utils.internal.RandomUtils

public final class RandomUtils extends Object
Internal random utilities.
  • Method Details

    • nextLongInclusive

      public static long nextLongInclusive(long upperBound)
      Generate a random long between 0 and the upper bound, both inclusive.
      Parameters:
      upperBound - the inclusive upper bound.
      Returns:
      a random long between 0 and the upper bound, both inclusive.
    • nextLongInclusive

      public static long nextLongInclusive(long lowerBound, long upperBound)
      Generate a random long between the specified lower and upper bound, both inclusive.
      Parameters:
      lowerBound - the inclusive lower bound.
      upperBound - the inclusive upper bound.
      Returns:
      a random long between the specified lower and upper bound, both inclusive.