public final class Randomness
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.util.Random |
get()
Provides a source of randomness that is reproducible when
running under the Elasticsearch test suite, and otherwise
produces a non-reproducible source of randomness.
|
static java.util.Random |
get(Settings settings,
Setting<java.lang.Long> setting)
Provides a reproducible source of randomness seeded by a long
seed in the settings with the key setting.
|
static void |
shuffle(java.util.List<?> list) |
public static java.util.Random get(Settings settings, Setting<java.lang.Long> setting)
settings
- the settings containing the seedsetting
- the setting to access the seedpublic static java.util.Random get()
java.lang.IllegalStateException
- if running tests but was not able
to acquire an instance of Random from
RandomizedContext or tests are
running but tests.seed is not setpublic static void shuffle(java.util.List<?> list)