Module org.junit.jupiter.params
Class SimpleArgumentConverter
java.lang.Object
org.junit.jupiter.params.converter.SimpleArgumentConverter
- All Implemented Interfaces:
ArgumentConverter
- Direct Known Subclasses:
DefaultArgumentConverter
@API(status=STABLE, since="5.7") public abstract class SimpleArgumentConverter extends Object implements ArgumentConverter
SimpleArgumentConverter is an abstract base class for ArgumentConverter
implementations.- Since:
- 5.0
- See Also:
ArgumentConverter
-
Constructor Summary
Constructors Constructor Description SimpleArgumentConverter() -
Method Summary
-
Constructor Details
-
SimpleArgumentConverter
public SimpleArgumentConverter()
-
-
Method Details
-
convert
public final Object convert(Object source, ParameterContext context) throws ArgumentConversionExceptionDescription copied from interface:ArgumentConverterConvert the suppliedsourceobject according to the suppliedcontext.- Specified by:
convertin interfaceArgumentConverter- Parameters:
source- the source object to convert; may benullcontext- the parameter context where the converted object will be used; nevernull- Returns:
- the converted object; may be
nullbut only if the target type is a reference type - Throws:
ArgumentConversionException- if an error occurs during the conversion
-
convert
protected abstract Object convert(Object source, Class<?> targetType) throws ArgumentConversionExceptionConvert the suppliedsourceobject into the suppliedtargetType.- Parameters:
source- the source object to convert; may benulltargetType- the target type the source object should be converted into; nevernull- Returns:
- the converted object; may be
nullbut only if the target type is a reference type - Throws:
ArgumentConversionException- in case an error occurs during the conversion
-