public class TestPojoBuilder<T> extends Object
| Constructor and Description |
|---|
TestPojoBuilder(Class<T> clazz) |
TestPojoBuilder(Class<T> clazz,
ProviderFunction providerFunction) |
| Modifier and Type | Method and Description |
|---|---|
TestPojoBuilder<T> |
addExcludedField(String fieldName)
Adds a field name to the builder so that this field will not be generated.
|
TestPojoBuilder<T> |
addExcludedFields(String fieldName,
String... fields)
Adds multiple fields to be excluded from generation.
|
TestPojoBuilder<T> |
addGenerator(Generator generator)
Adds a custom generator for a type that isn't currently supported out of the box.
|
TestPojoBuilder<T> |
addLimiter(String fieldName,
Limiter limiter)
Adds a new Limiter per field name that will limit and control the randomness of the generated field.
|
TestPojoBuilder<T> |
addProviderFunction(ProviderFunction providerFunction,
Class<?> clazz,
Class<?>... clazzes)
Adds a custom provider in order to allow the builder to know how to create a *New* object of that type.
|
T |
build()
Builds the object with the random data generated.
|
public TestPojoBuilder(Class<T> clazz, ProviderFunction providerFunction)
public TestPojoBuilder<T> addGenerator(Generator generator)
generator - generator for generating the new type of class.public TestPojoBuilder<T> addProviderFunction(ProviderFunction providerFunction, Class<?> clazz, Class<?>... clazzes)
providerFunction - a provider that news an object of a provided typeclazz - a mandatory class that will be created by the provider function.clazzes - additional classes that can be created by provider function.public TestPojoBuilder<T> addLimiter(String fieldName, Limiter limiter)
fieldName - the name of the fieldlimiter - the limiter for the fieldpublic TestPojoBuilder<T> addExcludedField(String fieldName)
fieldName - the field namepublic TestPojoBuilder<T> addExcludedFields(String fieldName, String... fields)
fieldName - the field name to ignorefields - the additional field names to ignorepublic T build()
Copyright © 2019. All rights reserved.