Class GeneratorResolver
java.lang.Object
de.cuioss.test.valueobjects.generator.dynamic.GeneratorResolver
Provides strategies for creating objects dynamically
- Author:
- Oliver Wolff
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<de.cuioss.test.generator.TypedGenerator<T>>
resolveCollectionGenerator
(Class<T> type) static <T> de.cuioss.test.generator.TypedGenerator<T>
resolveGenerator
(Class<T> type) Central method for finding / accessing a concreteTypedGenerator
for the given type.
-
Constructor Details
-
GeneratorResolver
public GeneratorResolver()
-
-
Method Details
-
resolveGenerator
Central method for finding / accessing a concreteTypedGenerator
for the given type. It works through all existing find methods. as last resort is usesInterfaceProxyGenerator
orDynamicProxyGenerator
that will always return a valid one Caution: The resolving system relies onTypedGeneratorRegistry
being configured properly, sayingTypedGeneratorRegistry.registerBasicTypes()
has been called prior to this method- Parameters:
type
- must not be null- Returns:
- a concrete
TypedGenerator
for the given type
-
resolveCollectionGenerator
public static <T> Optional<de.cuioss.test.generator.TypedGenerator<T>> resolveCollectionGenerator(Class<T> type) - Parameters:
type
- to be checked- Returns:
- an
TypedGenerator
if applicable or ornot
Optional.isPresent()
-