Class TypedArgumentConverter<S,​T>

    • Constructor Detail

      • TypedArgumentConverter

        protected TypedArgumentConverter​(Class<S> sourceType,
                                         Class<T> targetType)
    • Method Detail

      • convert

        public final Object convert​(Object source,
                                    ParameterContext context)
                             throws ArgumentConversionException
        Description copied from interface: ArgumentConverter
        Convert the supplied source object according to the supplied context.
        Specified by:
        convert in interface ArgumentConverter
        Parameters:
        source - the source object to convert; may be null
        context - the parameter context where the converted object will be used; never null
        Returns:
        the converted object; may be null but only if the target type is a reference type
        Throws:
        ArgumentConversionException - if an error occurs during the conversion
      • convert

        protected abstract T convert​(S source)
                              throws ArgumentConversionException
        Convert the supplied source object of type S into an object of type T.
        Parameters:
        source - the source object to convert; may be null
        Returns:
        the converted object
        Throws:
        ArgumentConversionException - in case an error occurs during the conversion