接口 Converter<S,​T>

  • 类型参数:
    S - the source type
    T - the target type
    所有已知实现类:
    DeserializingConverter, SerializingConverter

    public interface Converter<S,​T>
    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.

    从以下版本开始:
    3.0
    作者:
    Keith Donald
    • 方法详细资料

      • convert

        T convert​(S source)
        Convert the source object of type S to target type T.
        参数:
        source - the source object to convert, which must be an instance of S (never null)
        返回:
        the converted object, which must be an instance of T (potentially null)
        抛出:
        IllegalArgumentException - if the source cannot be converted to the desired target type