public class LoremIpsumObjectCreator extends Object
To avoid recursive infinite loops, this tool keeps track of previously populated instances of a certain type and reuse that instead.
For numbers being generated a random number is being using, for strings a lorem ipsum generated is being used.
createLoremIpsumObject(Class)| Constructor and Description |
|---|
LoremIpsumObjectCreator()
Default constructor: configures the Dummy Creator with vanilla new bindings and caches.
|
LoremIpsumObjectCreator(ClassBindings classBindings)
Constructor: configures the Dummy Creator with a given
ClassBindings instance and new caches. |
LoremIpsumObjectCreator(LoremIpsumConfig loremIpsumConfig)
Default constructor: configures the Dummy Creator with vanilla new bindings and caches.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createLoremIpsumObject(Class<T> clazz)
Main method, creates a dummy object of a given type (using
ClassBasedFactory#createLoremIpsumObject(Type[], Map, ClassBindings, List)). |
public LoremIpsumObjectCreator()
public LoremIpsumObjectCreator(ClassBindings classBindings)
ClassBindings instance and new caches.public LoremIpsumObjectCreator(LoremIpsumConfig loremIpsumConfig)
public <T> T createLoremIpsumObject(Class<T> clazz)
ClassBasedFactory#createLoremIpsumObject(Type[], Map, ClassBindings, List)).
Provide your own ClassBindings in LoremIpsumObjectCreator(ClassBindings) to control how objects are created for specific types
(such as the abstract List class). This is the main-method used to create a dummy of a certain class. It's called with the needed
class. e.g. Integer i = createLoremIpsumObjectOfClass(Integer.class)
T - The type to be created and returned (returned type can be a sub type of T).clazz - The type that should be createdClassBindings are configured!).IllegalArgumentException - Thrown if an abstract type or interface was given for which no binding could be found in the
provided ClassBindings.Copyright © 2019–2020. All rights reserved.