接口 Converter<S,T>
- 类型参数:
S
- the source typeT
- the target type
public interface Converter<S,T>
A converter converts a source object of typeS
to a target of typeT
.Implementations of this interface are thread-safe and can be shared.
Implementations may additionally implement
ConditionalConverter
.- 从以下版本开始:
- 3.0
- 作者:
- Keith Donald
方法详细资料
convert
T convert(S source)
Convert the source object of typeS
to target typeT
.- 参数:
source
- the source object to convert, which must be an instance ofS
(nevernull
)- 返回:
- the converted object, which must be an instance of
T
(potentiallynull
) - 抛出:
IllegalArgumentException
- if the source cannot be converted to the desired target type