Class Randomness


  • public final class Randomness
    extends java.lang.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:
    RandomizedContext
    • Field Detail

      • seed

        private final long seed
      • random

        private final java.util.Random random
    • Method Detail

      • getRandom

        public java.util.Random getRandom()
        Random instance for this randomness.
      • clone

        Randomness clone​(java.lang.Thread newOwner)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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.