Package com.consol.citrus.util
Class TypeConversionUtils
- java.lang.Object
-
- com.consol.citrus.util.TypeConversionUtils
-
public abstract class TypeConversionUtils extends Object
- Since:
- 2.5
- Author:
- Christoph Deppisch
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TconvertIfNecessary(Object target, Class<T> type)Converts target object to required type if necessary.static <T> TconvertStringToType(String value, Class<T> type)Convert value string to required type.static <T> TconvertStringToType(String value, Class<T> type, TestContext context)Convert value string to required type or read bean of type from application context.static voidloadDefaultConverter()Reload default type converter.
-
-
-
Method Detail
-
loadDefaultConverter
public static void loadDefaultConverter()
Reload default type converter.
-
convertIfNecessary
public static <T> T convertIfNecessary(Object target, Class<T> type)
Converts target object to required type if necessary.- Type Parameters:
T-- Parameters:
target-type-- Returns:
-
convertStringToType
public static <T> T convertStringToType(String value, Class<T> type)
Convert value string to required type.- Parameters:
value-type-- Returns:
-
convertStringToType
public static <T> T convertStringToType(String value, Class<T> type, TestContext context)
Convert value string to required type or read bean of type from application context.- Parameters:
value-type-context-- Returns:
-
-