Class Randomness
- java.lang.Object
-
- com.carrotsearch.randomizedtesting.Randomness
-
public final class Randomness extends java.lang.ObjectPer-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 Summary
Fields Modifier and Type Field Description private SeedDecorator[]decoratorsprivate java.util.Randomrandomprivate longseedprivate RandomSuppliersupplier
-
Constructor Summary
Constructors Constructor Description Randomness(long seed, RandomSupplier supplier, SeedDecorator... decorators)Randomness(java.lang.Thread owner, RandomSupplier supplier, long seed, SeedDecorator... decorators)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) Randomnessclone(java.lang.Thread newOwner)private static longdecorate(long seed, SeedDecorator[] decorators)Decorate a given seed.(package private) voiddestroy()Invalidate the underling randomness.(package private) SeedDecorator[]getDecorators()java.util.RandomgetRandom()Random instance for this randomness.(package private) RandomSuppliergetRandomSupplier()(package private) longgetSeed()Starting seed, read-only for tests.java.lang.StringtoString()
-
-
-
Field Detail
-
seed
private final long seed
-
random
private final java.util.Random random
-
supplier
private final RandomSupplier supplier
-
decorators
private final SeedDecorator[] decorators
-
-
Constructor Detail
-
Randomness
public Randomness(java.lang.Thread owner, RandomSupplier supplier, long seed, SeedDecorator... decorators)
-
Randomness
public Randomness(long seed, RandomSupplier supplier, SeedDecorator... decorators)
-
-
Method Detail
-
getRandom
public java.util.Random getRandom()
Random instance for this randomness.
-
getRandomSupplier
RandomSupplier getRandomSupplier()
-
getDecorators
SeedDecorator[] getDecorators()
-
clone
Randomness clone(java.lang.Thread newOwner)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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.
-
-