Class ConstructorInstantiator
java.lang.Object
redempt.redlib.config.instantiation.ConstructorInstantiator
- All Implemented Interfaces:
Instantiator
An instantiator used for record types which passes in all necessary fields
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> InstantiatorcreateDefault(Class<?> clazz) Attempts to create an Instantiator for a record type, or a class which has a constructor taking all its fields in the same order they appear in the class<T> Tinstantiate(ConversionManager manager, Object target, Class<T> clazz, List<Object> values, String path, FieldSummary info) Instantiates a new object using its constructor
-
Method Details
-
createDefault
Attempts to create an Instantiator for a record type, or a class which has a constructor taking all its fields in the same order they appear in the class- Type Parameters:
T- The type- Parameters:
clazz- The class to create an Instantiator for- Returns:
- An Instantiator
-
instantiate
public <T> T instantiate(ConversionManager manager, Object target, Class<T> clazz, List<Object> values, String path, FieldSummary info) Instantiates a new object using its constructor- Specified by:
instantiatein interfaceInstantiator- Type Parameters:
T- The type- Parameters:
manager- The ConversionManager handling converterstarget- The target object, always ignored by this type of Instantiatorclazz- The class whose fields are being usedvalues- The values for the fieldspath- The path in configinfo- Extra info about the instantiation- Returns:
- The constructed object
-