public abstract class LoremIpsumObjectFactory<T> extends Object
| Constructor and Description |
|---|
LoremIpsumObjectFactory() |
| Modifier and Type | Method and Description |
|---|---|
T |
createLoremIpsumObject()
Delegates to
createLoremIpsumObject(LoremIpsumConfig) with the default bindings. |
T |
createLoremIpsumObject(@Nullable LoremIpsumConfig loremIpsumConfig)
Starts a new chain for the creation of a dummy with an empty list of known class instances and empty list of exceptions.
|
T |
createLoremIpsumObject(@Nullable Type[] genericMetaData,
@Nullable Map<String,ClassUsageInfo<?>> knownInstances,
LoremIpsumConfig loremIpsumConfig,
@Nullable List<Exception> exceptions)
Creates a new instance of one of the following: the requested type, a sub type of the requested type or, if the requested type is an
interface definition, a suitable implementation.
|
boolean |
isValidForType(Class<? super T> clazz)
Default implementation returns true.
|
public boolean isValidForType(Class<? super T> clazz)
@Nullable public final T createLoremIpsumObject()
createLoremIpsumObject(LoremIpsumConfig) with the default bindings.@Nullable public final T createLoremIpsumObject(@Nullable @Nullable LoremIpsumConfig loremIpsumConfig)
loremIpsumConfig - A list of bindings to which a factory may defer dummy creation to.createLoremIpsumObject(Type[], Map, LoremIpsumConfig, List).@Nullable public T createLoremIpsumObject(@Nullable @Nullable Type[] genericMetaData, @Nullable @Nullable Map<String,ClassUsageInfo<?>> knownInstances, LoremIpsumConfig loremIpsumConfig, @Nullable @Nullable List<Exception> exceptions)
null if nothing can be found. In case of method/constructor
errors due to generated test data falling out of a range or causing a timeout, the process is retried a few times for each step (for example
when a method really wants a small numbers, but a large number is generated the first time).
If there are known exceptions (reflection exceptions when invoking a Constructor for example), don't throw them, but record
them in the given exceptions list. Not all failures are counted towards complete failures.
genericMetaData - Can be null. Should be non-null when requested type is a List or Map.knownInstances - A list of previously created and populated objects for a specific type.loremIpsumConfig - A list of bindings to which a factory may defer dummy creation to.exceptions - A list in which to store exceptions so they can be logged at some later point. This is done so, because not all
exceptions are bad (in case a factory is trying to find a useful constructor, invocations are allowed to fail if a
suitable constructor can be found otherwise).Copyright © 2019–2020. All rights reserved.