@API(status=EXPERIMENTAL, since="5.0") public interface ArgumentConverter
ArgumentConverteris an abstraction that allows an input object to be converted to an instance of a different class.
Implementations must provide a no-args constructor and should not make any assumptions regarding when they are instantiated or how often they are called. Since instances may potentially be cached and called from different threads, they should be thread-safe and designed to be used as singletons.
Object convert(Object source, ParameterContext context) throws ArgumentConversionExceptionConvert the supplied
sourceobject according to the supplied
source- the source object to convert; may be
context- the parameter context where the converted object will be used; never
- the converted object; may be
nullbut only if the target type is a reference type
ArgumentConversionException- if an error occurs during the conversion