public abstract class EnhancedRandom extends Random
Constructor and Description |
---|
EnhancedRandom() |
Modifier and Type | Method and Description |
---|---|
abstract <T> T |
nextObject(Class<T> type,
String... excludedFields)
Generate a random instance of the given type.
|
abstract <T> java.util.stream.Stream<T> |
objects(Class<T> type,
int streamSize,
String... excludedFields)
Generate a stream of random instances of the given type.
|
static <T> java.util.stream.Stream<T> |
random(Class<T> type,
int streamSize,
String... excludedFields)
Generate a stream of random instances of the given type.
|
static <T> T |
random(Class<T> type,
String... excludedFields)
Generate a random instance of the given type.
|
public abstract <T> T nextObject(Class<T> type, String... excludedFields)
T
- the actual type of the target objecttype
- the type for which an instance will be generatedexcludedFields
- the name of fields to excludeObjectGenerationException
- when unable to populate an instance of the given typepublic abstract <T> java.util.stream.Stream<T> objects(Class<T> type, int streamSize, String... excludedFields)
T
- the actual type of the target objectstype
- the type for which instances will be generatedstreamSize
- the number of instances to generateexcludedFields
- the name of fields to excludeObjectGenerationException
- when unable to populate an instance of the given typepublic static <T> T random(Class<T> type, String... excludedFields)
T
- the target typetype
- the target class typeexcludedFields
- the name of fields to excludepublic static <T> java.util.stream.Stream<T> random(Class<T> type, int streamSize, String... excludedFields)
T
- the actual type of the target objectstype
- the type for which instances will be generatedstreamSize
- the number of instances to generateexcludedFields
- the name of fields to excludeObjectGenerationException
- when unable to populate an instance of the given typeCopyright © 2016. All Rights Reserved.