S
- the source typeT
- the target type@FunctionalInterface public interface Converter<S,T>
S
to a target of type T
.
Implementations of this interface are thread-safe and can be shared.
Implementations may additionally implement ConditionalConverter
.
Modifier and Type | Method and Description |
---|---|
default <U> Converter<S,U> |
andThen(Converter<? super T,? extends U> after)
|
T |
convert(S source)
Convert the source object of type
S to target type T . |
@Nullable T convert(S source)
S
to target type T
.source
- the source object to convert, which must be an instance of S
(never null
)T
(potentially null
)IllegalArgumentException
- if the source cannot be converted to the desired target type