public interface ValueConverter<S,T>
Bi-directional converter of values from one (source) type to values of another (target) type and vice versa.
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsSourceValue(Object value)
Returns true if the converter knows how to convert the given source value to the target type.
|
boolean |
acceptsTargetType(Class<?> clazz)
Returns true if the converter knows how to convert the given target type to the source type.
|
boolean |
acceptsTargetValue(Object value)
Returns true if the converter knows how to convert the given target value to the source type.
|
S |
convertToSourceType(Object value)
Converts the given target value to the source type.
|
T |
convertToTargetType(Object value)
Converts the given source value to the target type.
|
String |
getName()
The name of the converter.
|
String getName()
The name of the converter.
boolean acceptsSourceValue(Object value)
Returns true if the converter knows how to convert the given source value to the target type.
value
- the candidate source valueboolean acceptsTargetValue(Object value)
Returns true if the converter knows how to convert the given target value to the source type.
value
- the candidate target valueboolean acceptsTargetType(Class<?> clazz)
Returns true if the converter knows how to convert the given target type to the source type.
clazz
- the candidate target typeT convertToTargetType(Object value)
Converts the given source value to the target type. This is sort of a 'serialization'.
value
- the source value to convertCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.