Interface ConverterManager


  • @Role
    public interface ConverterManager
    Simple API to do universal conversion between two types.

    To add support for another target type, implements a new Converter component

    Since:
    2.0M2
    Version:
    $Id: dbab3f6b3e99306db08147cf60024fd94d011c58 $
    • Method Detail

      • convert

        <T> T convert​(Type targetType,
                      Object sourceValue)
        Convert provided value into the provided target type.
        Type Parameters:
        T - the type in which the provided value has to be converted
        Parameters:
        targetType - the type in which the provided value has to be converted
        sourceValue - the value to convert
        Returns:
        the converted value
        Since:
        3.0M1
      • getConverter

        default <T> Converter<T> getConverter​(Type targetType)
        Type Parameters:
        T - the type in which the provided value has to be converted
        Parameters:
        targetType - the type for which the converter has been registered
        Returns:
        the converter associated to the provided type or null if none could be found
        Since:
        9.0RC1