Interface Converter<S,T>
- Type Parameters:
S- the source typeT- the target type
- All Known Implementing Classes:
DeserializingConverter,SerializingConverter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A converter converts a source object of type
S to a target of type T.
Implementations of this interface are thread-safe and can be shared.
Implementations may additionally implement ConditionalConverter.
- Since:
- 3.0
- Author:
- Keith Donald, Josh Cummings
-
Method Summary
Modifier and TypeMethodDescriptionConvert the source object of typeSto target typeT.
-
Method Details
-
convert
Convert the source object of typeSto target typeT.- Parameters:
source- the source object to convert, which must be an instance ofS(nevernull)- Returns:
- the converted object, which must be an instance of
T(potentiallynull) - Throws:
IllegalArgumentException- if the source cannot be converted to the desired target type
-
andThen
-