public class RandomIndustrialArea extends Object
RandomFactory
s and possible some self made random
fields or options or whatever might be necessary for even better optimization.Constructor and Description |
---|
RandomIndustrialArea() |
Modifier and Type | Method and Description |
---|---|
void |
addFactory(RandomFactory<?> factory)
Adds a
RandomFactory to this industrial area. |
<T> boolean |
containsRandomFactoryFor(Class<T> pojoClass)
Returns if there is a
RandomFactory for the class. |
<T> List<T> |
create(Class<T> createdClass,
int count)
Creates some instances of the class this factory is for.
|
<T> T |
createSingle(Class<T> pojoClass)
Creates a single instance of the class.
|
RandomIndustrialArea |
creationDepth(int newCreationDepth)
Returns the depth for the hierarchical POJOs that might be created.
|
<T> RandomFactory<T> |
findRandomFactory(Class<T> pojoClass)
Returns the
RandomFactory for the class or null. |
static RandomIndustrialArea |
forClasses(Class<?>... createdClasses)
Creates a default
RandomFactory for the class. |
int |
getCreationDepth()
Returns the depth for the hierarchical POJOs that might be created.
|
<T> RandomFactory<T> |
getRandomFactory(Class<T> pojoClass)
Returns the
RandomFactory for the class. |
void |
removeFactory(Class<?> pojoClass)
Removes a
RandomFactory from this industrial area. |
void |
removeFactory(RandomFactory<?> factory)
Removes a
RandomFactory from this industrial area. |
void |
setCreationDepth(int creationDepth)
Returns the depth for the hierarchical POJOs that might be created.
|
public static RandomIndustrialArea forClasses(Class<?>... createdClasses)
RandomFactory
for the class. This is a handy method
for creating an entire RandomIndustrialArea
based on guess work.createdClasses
- the classes to be guessedpublic void addFactory(RandomFactory<?> factory)
RandomFactory
to this industrial area.factory
- a factory to add; cannot be nullpublic void removeFactory(RandomFactory<?> factory)
RandomFactory
from this industrial area.factory
- the factory to remove; cannot be nullpublic void removeFactory(Class<?> pojoClass)
RandomFactory
from this industrial area.pojoClass
- the POJO's class to removepublic <T> RandomFactory<T> getRandomFactory(Class<T> pojoClass) throws RandomException
RandomFactory
for the class.T
- the type the factory is forpojoClass
- the class that should be createdRandomException
- if no RandomFactory
was foundpublic <T> RandomFactory<T> findRandomFactory(Class<T> pojoClass)
RandomFactory
for the class or null.T
- the type the factory is forpojoClass
- the class that should be createdpublic <T> boolean containsRandomFactoryFor(Class<T> pojoClass)
RandomFactory
for the class.T
- the type the factory is forpojoClass
- the class that should be createdRandomException
- if none was fondpublic <T> T createSingle(Class<T> pojoClass) throws RandomException
T
- the type the factory is forpojoClass
- the class to be createdRandomException
- - if something went wrongpublic <T> List<T> create(Class<T> createdClass, int count) throws RandomException
T
- the type the factory is forcreatedClass
- the class to be createdcount
- number of instances to be createdRandomException
- - if something went wrongpublic int getCreationDepth()
public RandomIndustrialArea creationDepth(int newCreationDepth)
newCreationDepth
- an integer > 0public void setCreationDepth(int creationDepth)
creationDepth
- an integer > 0Copyright © 2020. All rights reserved.