public class RandomDataGenerator extends Object
| Constructor and Description |
|---|
RandomDataGenerator()
Creates a new random data generator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generateBytes(byte[] bytes)
Fills the given array with random bytes.
|
boolean |
getBoolean()
Generates a random boolean.
|
<E extends Enum<E>> |
getEnum(Class<E> enumClass)
Generates one of the constants of the given enum class.
|
int |
getInt()
Generates a random integer.
|
long |
getLong()
Generates a random long.
|
int |
getPositiveInt()
Generates a positive integer.
|
public RandomDataGenerator()
public long getLong()
public int getInt()
public int getPositiveInt()
public void generateBytes(byte[] bytes)
bytes - the array to fill with random bytespublic boolean getBoolean()
public <E extends Enum<E>> E getEnum(Class<E> enumClass) throws NullPointerException, IllegalArgumentException
E - the enum typeenumClass - the enum classNullPointerException - if enumClass is nullIllegalArgumentException - if enum type does not define any constantsCopyright © 2015. All rights reserved.