@ConsumerType public interface Converter
Type converter to convert an object to a target type.
  • ????

    ??????
    ??
    ??
    boolean
    canConvert(Object sourceObject, ReifiedType targetType)
    Return if this converter is able to convert the specified object to the specified type.
    convert(Object sourceObject, ReifiedType targetType)
    Convert the specified object to an instance of the specified type.
  • ??????

    • canConvert

      boolean canConvert(Object sourceObject, ReifiedType targetType)
      Return if this converter is able to convert the specified object to the specified type.
      ??:
      sourceObject - The source object s to convert.
      targetType - The target type T.
      ??:
      true if the conversion is possible, false otherwise.
    • convert

      Object convert(Object sourceObject, ReifiedType targetType) throws Exception
      Convert the specified object to an instance of the specified type.
      ??:
      sourceObject - The source object s to convert.
      targetType - The target type T.
      ??:
      An instance with a type that is assignable from targetType's raw class
      ??:
      Exception - If the conversion cannot succeed. This exception should not be thrown when the canConvert method has returned true.