Package host.anzo.commons.config
Class ConfigTypeCaster
java.lang.Object
host.anzo.commons.config.ConfigTypeCaster
The Type Caster is small utility that helps put string values into object fields with different types.
- Since:
- 02.04.2017
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ConfigTypeCaster
public ConfigTypeCaster()
-
-
Method Details
-
cast
public static void cast(Object object, @NotNull @NotNull Field field, String value, String splitter, Long minValue, Long maxValue) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException Puts value to field.- Parameters:
object- Object, whom field value should be changed.field- Class field.value- Value to cast.splitter- splitter symbol for collection type fields- Throws:
IllegalAccessExceptionInvocationTargetExceptionInstantiationExceptionNoSuchMethodException
-
cast
Changes targets' value to new given value with type casting.- Parameters:
type- Cast type.value- Value to cast.- Throws:
IllegalAccessException
-