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

public Class DefaultArgumentConverter

extends Object
implements ArgumentConverter
Class Inheritance
All Implemented Interfaces
org.junit.jupiter.params.converter.ArgumentConverter
Annotations
@API
status:INTERNAL
since:5.0
Static Imports
org.apiguardian.api.API.Status.INTERNAL, org.junit.platform.commons.util.ClassLoaderUtils.getClassLoader

DefaultArgumentConverter is the default implementation of the ArgumentConverter API.

The DefaultArgumentConverter is able to convert from strings to a number of primitive types and their corresponding wrapper types (Byte, Short, Integer, Long, Float, and Double), date and time types from the java.time package, and some additional common Java types such as File, BigDecimal, BigInteger, Currency, Locale, URI, URL, UUID, etc.

If the source and target types are identical the source object will not be modified.

Since
5.0
See Also
org.junit.jupiter.params.converter.ArgumentConverter, org.junit.platform.commons.support.conversion.ConversionSupport

Field Summary

Modifier and TypeField and Description
public static final DefaultArgumentConverter

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public final @Nullable Object
public final @Nullable Object
public final @Nullable Object
convert(@Nullable Object source, Class<?> targetType, ClassLoader classLoader)

pack-priv @Nullable Object
convert(@Nullable String source, Class<?> targetType, ClassLoader classLoader)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final DefaultArgumentConverter INSTANCE

Constructor Detail

DefaultArgumentConverterback to summary
private DefaultArgumentConverter()

Method Detail

convertback to summary
public final @Nullable Object convert(@Nullable Object source, ParameterContext context)
Annotations
@Override
convertback to summary
public final @Nullable Object convert(@Nullable Object source, FieldContext context) throws ArgumentConversionException
Annotations
@Override
convertback to summary
public final @Nullable Object convert(@Nullable Object source, Class<?> targetType, ClassLoader classLoader)
convertback to summary
pack-priv @Nullable Object convert(@Nullable String source, Class<?> targetType, ClassLoader classLoader)