public abstract class EnhancedRandom
extends java.util.Random
EnhancedRandomBuilder.| Constructor and Description |
|---|
EnhancedRandom() |
| Modifier and Type | Method and Description |
|---|---|
abstract <T> T |
nextObject(java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a random instance of the given type.
|
abstract <T> java.util.stream.Stream<T> |
objects(java.lang.Class<T> type,
int amount,
java.lang.String... excludedFields)
Generate a stream of random instances of the given type.
|
static <T> T |
random(java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a random instance of the given type.
|
static <T> java.util.Collection<T> |
randomCollectionOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a
Collection of random instances of the given type. |
static <T> java.util.List<T> |
randomListOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a
List of random instances of the given type. |
static <T> java.util.Set<T> |
randomSetOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a
Set of random instances of the given type. |
static <T> java.util.stream.Stream<T> |
randomStreamOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Generate a stream of random instances of the given type.
|
public static <T> T random(java.lang.Class<T> type,
java.lang.String... excludedFields)
EnhancedRandomBuilder.T - the target typetype - the target class typeexcludedFields - the name of fields to excludepublic static <T> java.util.stream.Stream<T> randomStreamOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
EnhancedRandomBuilder.T - the actual type of the target objectsamount - the number of instances to generatetype - the type for which instances will be generatedexcludedFields - the name of fields to excludeObjectGenerationException - when unable to populate an instance of the given typepublic static <T> java.util.List<T> randomListOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
List of random instances of the given type.
This method uses default parameters and does not take into account configuration parameters set with EnhancedRandomBuilder.T - the actual type of the target objectsamount - the number of instances to generatetype - the type for which instances will be generatedexcludedFields - the name of fields to excludeObjectGenerationException - when unable to populate an instance of the given typepublic static <T> java.util.Set<T> randomSetOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Set of random instances of the given type.
This method uses default parameters and does not take into account configuration parameters set with EnhancedRandomBuilder.T - the actual type of the target objectsamount - the number of instances to generatetype - the type for which instances will be generatedexcludedFields - the name of fields to excludeObjectGenerationException - when unable to populate an instance of the given typepublic static <T> java.util.Collection<T> randomCollectionOf(int amount,
java.lang.Class<T> type,
java.lang.String... excludedFields)
Collection of random instances of the given type.
This method uses default parameters and does not take into account configuration parameters set with EnhancedRandomBuilder.T - the actual type of the target objectsamount - the number of instances to generatetype - the type for which instances will be generatedexcludedFields - the name of fields to excludeObjectGenerationException - when unable to populate an instance of the given typepublic abstract <T> T nextObject(java.lang.Class<T> type,
java.lang.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(java.lang.Class<T> type,
int amount,
java.lang.String... excludedFields)
T - the actual type of the target objectstype - the type for which instances will be generatedamount - the number of instances to generateexcludedFields - the name of fields to excludeObjectGenerationException - when unable to populate an instance of the given typeCopyright © 2019. All Rights Reserved.