Class AbstractOrderedArgsInstantiator<T>
java.lang.Object
de.cuioss.test.valueobjects.objects.impl.AbstractOrderedArgsInstantiator<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
ParameterizedInstantiator<T>
- Direct Known Subclasses:
ConstructorBasedInstantiator
,FactoryBasedInstantiator
public abstract class AbstractOrderedArgsInstantiator<T>
extends Object
implements ParameterizedInstantiator<T>
Base class for creating objects with a fixed set of parameter to be used.
This can be constructor and or factory based
ParameterizedInstantiator
.- Author:
- Oliver Wolff
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractOrderedArgsInstantiator
(RuntimeProperties runtimeProperties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
doInstantiate
(Object... args) The actual instantiation method for theObject
snewInstance
(List<PropertyMetadata> properties) Similar toParameterizedInstantiator.newInstance(List, boolean)
but with the difference that the caller has no control regarding the set / applied properties, that may be need for some asserts.newInstance
(List<PropertySupport> properties, boolean generatePropertyValues) Creates a new Object according to the given parameter, represented asList
ofPropertySupport
protected List<PropertySupport>
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.cuioss.test.valueobjects.objects.ParameterizedInstantiator
getRuntimeProperties
-
Constructor Details
-
AbstractOrderedArgsInstantiator
Constructor.- Parameters:
runtimeProperties
- must not be null. defines the attributes in the exact order to be used for the constructor:RuntimeProperties#getAllProperties()
-
-
Method Details
-
newInstance
Description copied from interface:ParameterizedInstantiator
Creates a new Object according to the given parameter, represented asList
ofPropertySupport
- Specified by:
newInstance
in interfaceParameterizedInstantiator<T>
- Parameters:
properties
- to be applied to the newly created object.generatePropertyValues
- indicating whether this method should implicitly callPropertySupport.generateTestValue()
or not. In case beingfalse
the caller must ensure this.- Returns:
- a newly created object with the given properties being applied.
-
doInstantiate
The actual instantiation method for theObject
s- Parameters:
args
- Object[] of parameter to be passed to Constructor / factory , method- Returns:
- the instantiated
Object
-
newInstance
Description copied from interface:ParameterizedInstantiator
Similar toParameterizedInstantiator.newInstance(List, boolean)
but with the difference that the caller has no control regarding the set / applied properties, that may be need for some asserts. It is some kind of any()- Specified by:
newInstance
in interfaceParameterizedInstantiator<T>
- Parameters:
properties
- to be applied to the newly created object.- Returns:
- a newly created object with the given properties being applied.
-
newInstanceMinimal
- Specified by:
newInstanceMinimal
in interfaceParameterizedInstantiator<T>
- Returns:
- a new instance of the object with only required attributes set.
-
newInstanceFull
- Specified by:
newInstanceFull
in interfaceParameterizedInstantiator<T>
- Returns:
- a new instance of the object with all attributes set.
-
resolveFixedArgumentList
-