public interface IConverter
Modifier and Type | Method and Description |
---|---|
Object |
convertArrayToString(Object o)
Handles conversions of Arrays of Objects to Arrays of String.
|
Object |
convertArrayToType(Class<?> type,
Object o)
Requests conversion to Arrays of one of the types handled by the
IConverter . |
Collection<?> |
convertCollectionToString(Object o)
Handles conversions of Collections of Objects to Collections of String.
|
Collection<?> |
convertCollectionToType(Class<?> type,
Object o)
Requests conversion to Collections of one of the types handled by the
IConverter . |
String |
convertToString(Object o)
Requests conversion to a String for the provided Object.
|
<T> T |
convertToType(Class<T> type,
Object o)
Requests conversion to a one of the types handled by the
IConverter . |
Class<?>[] |
getTypes()
Returns types handled by the converter.
|
Object |
stringConversion(Object o)
Requests to choose between
convertToString(Object) , convertArrayToString(Object) depending on
provided Object type. |
Object |
typeConversion(Class<?> type,
Object o)
Requests to choose between
convertToType(Class, Object) , convertArrayToType(Class, Object) depending on
provided Object type. |
Object stringConversion(Object o) throws UtilsException
convertToString(Object)
, convertArrayToString(Object)
depending on
provided Object type.UtilsException
String convertToString(Object o) throws UtilsException
IConverter
, otherwise the default Object.toString()
is invoked.stringConversion(Object)
in these cases.UtilsException
Object convertArrayToString(Object o) throws UtilsException
UtilsException
Collection<?> convertCollectionToString(Object o) throws UtilsException
UtilsException
Object typeConversion(Class<?> type, Object o) throws UtilsException
convertToType(Class, Object)
, convertArrayToType(Class, Object)
depending on
provided Object type.UtilsException
<T> T convertToType(Class<T> type, Object o) throws UtilsException
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to stringConversion(Object)
.typeConversion(Class, Object)
in these cases.UtilsException
Object convertArrayToType(Class<?> type, Object o) throws UtilsException
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to stringConversion(Object)
.UtilsException
Collection<?> convertCollectionToType(Class<?> type, Object o) throws UtilsException
IConverter
. If the type is not handled, an Exception
will be raised.String
.class, and redirect to stringConversion(Object)
.UtilsException
Class<?>[] getTypes()