Class Randomness

java.lang.Object
com.carrotsearch.randomizedtesting.Randomness

public final class Randomness extends Object
Per-thread, per-lifecycle state randomness defined as an initial seed and the current Random instance.

An instance of this class will be typically available from RandomizedContext. No need to instantiate manually.

See Also:
  • Field Details

    • seed

      private final long seed
    • random

      private final Random random
    • supplier

      private final RandomSupplier supplier
    • decorators

      private final SeedDecorator[] decorators
  • Constructor Details

  • Method Details

    • getRandom

      public Random getRandom()
      Random instance for this randomness.
    • getRandomSupplier

      RandomSupplier getRandomSupplier()
    • getDecorators

      SeedDecorator[] getDecorators()
    • clone

      Randomness clone(Thread newOwner)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • destroy

      void destroy()
      Invalidate the underling randomness.
    • getSeed

      long getSeed()
      Starting seed, read-only for tests.
    • decorate

      private static long decorate(long seed, SeedDecorator[] decorators)
      Decorate a given seed.