Top Description Constructors Methods
org.junit.jupiter.params.converter

public abstract Class SimpleArgumentConverter

extends Object
implements ArgumentConverter
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.params.converter.ArgumentConverter
Annotations
@API
status:STABLE
since:5.7
Static Imports
org.apiguardian.api.API.Status.STABLE

SimpleArgumentConverter is an abstract base class for ArgumentConverter implementations that only need to know the target type and do not need access to the ParameterContext to perform the conversion.
Since
5.0
See Also
ArgumentConverter, TypedArgumentConverter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final @Nullable Object
public final @Nullable Object
protected abstract @Nullable Object

Returns:

the converted object; may be null but only if the target type is a reference type
convert
(@Nullable Object
the source object to convert; may be null
source
,
Class<?>
the target type the source object should be converted into; never null
targetType
)

Convert the supplied source object into the supplied targetType.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SimpleArgumentConverterback to summary
public SimpleArgumentConverter()

Method Detail

convertback to summary
public final @Nullable Object convert(@Nullable Object source, ParameterContext context) throws ArgumentConversionException
Annotations
@Override
convertback to summary
public final @Nullable Object convert(@Nullable Object source, FieldContext context) throws ArgumentConversionException
Annotations
@Override
convertback to summary
protected abstract @Nullable Object convert(@Nullable Object source, Class<?> targetType) throws ArgumentConversionException

Convert the supplied source object into the supplied targetType.

Parameters
source:@Nullable Object

the source object to convert; may be null

targetType:Class<?>

the target type the source object should be converted into; never null

Returns:@Nullable Object

the converted object; may be null but only if the target type is a reference type

Exceptions
ArgumentConversionException:
in case an error occurs during the conversion