public class EnumRandomizer<T extends Enum<T>> extends AbstractRandomizer<Enum<T>>
Randomizer
that generates a random value from a given enumeration values set.random
Constructor and Description |
---|
EnumRandomizer(Class<T> enumeration)
Create a new
EnumRandomizer . |
EnumRandomizer(Class<T> enumeration,
long seed)
Create a new
EnumRandomizer . |
Modifier and Type | Method and Description |
---|---|
static <R extends Enum<R>> |
aNewEnumRandomizer(Class<R> enumeration)
Create a new
EnumRandomizer . |
static <R extends Enum<R>> |
aNewEnumRandomizer(Class<R> enumeration,
long seed)
Create a new
EnumRandomizer . |
Enum<T> |
getRandomValue()
Generate a random value for the given type.
|
public EnumRandomizer(Class<T> enumeration)
EnumRandomizer
.enumeration
- the enumeration from which this randomizer will generate random valuespublic EnumRandomizer(Class<T> enumeration, long seed)
EnumRandomizer
.enumeration
- the enumeration from which this randomizer will generate random valuesseed
- the initial seedpublic static <R extends Enum<R>> EnumRandomizer<R> aNewEnumRandomizer(Class<R> enumeration)
EnumRandomizer
.enumeration
- the enumeration from which this randomizer will generate random valuesEnumRandomizer
.public static <R extends Enum<R>> EnumRandomizer<R> aNewEnumRandomizer(Class<R> enumeration, long seed)
EnumRandomizer
.enumeration
- the enumeration from which this randomizer will generate random valuesseed
- the initial seedEnumRandomizer
.public Enum<T> getRandomValue()
Randomizer
Copyright © 2016. All Rights Reserved.