Class Morph<T>
java.lang.Object
org.klojang.convert.Morph<T>
- Type Parameters:
T
- The type to which incoming values will be converted
Performs a wide variety of type conversions.
- Author:
- Ayco Holleman
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Morph
-
-
Method Details
-
convert
Converts the specified object to the specified type.- Type Parameters:
U
- The target type- Parameters:
obj
- The value to converttargetType
- TheClass
object corresponding to the target type- Returns:
- The converted value
- Throws:
TypeConversionException
- If the conversion did not succeed
-
convert
Converts the specified object into an instance of the type specified through the constructor.- Parameters:
obj
- The value to convert- Returns:
- An instance of the target type
- Throws:
TypeConversionException
- If the conversion did not succeed
-