Class RandomUtils

java.lang.Object
io.github.projectunified.cronutils.utils.RandomUtils

public class RandomUtils extends Object
Utility class for random number generation in cron expressions. This is used primarily for OpenBSD-style random intervals using the '~' character.
  • Constructor Details

    • RandomUtils

      public RandomUtils()
    • RandomUtils

      public RandomUtils(Random random)
  • Method Details

    • nextInt

      public int nextInt(int bound)
      Generate a random integer between 0 (inclusive) and bound (exclusive)
      Parameters:
      bound - the upper bound (exclusive)
      Returns:
      random integer
    • nextInt

      public int nextInt(int min, int max)
      Generate a random integer between min (inclusive) and max (exclusive)
      Parameters:
      min - minimum value (inclusive)
      max - maximum value (exclusive)
      Returns:
      random integer