Class JavaTimeArgumentConverter
- java.lang.Object
-
- org.junit.jupiter.params.converter.SimpleArgumentConverter
-
- org.junit.jupiter.params.converter.JavaTimeArgumentConverter
-
- All Implemented Interfaces:
java.util.function.Consumer<JavaTimeConversionPattern>
,ArgumentConverter
,AnnotationConsumer<JavaTimeConversionPattern>
class JavaTimeArgumentConverter extends SimpleArgumentConverter implements AnnotationConsumer<JavaTimeConversionPattern>
- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
pattern
private static java.util.Map<java.lang.Class<?>,java.time.temporal.TemporalQuery<?>>
TEMPORAL_QUERIES
-
Constructor Summary
Constructors Constructor Description JavaTimeArgumentConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(JavaTimeConversionPattern annotation)
java.lang.Object
convert(java.lang.Object input, java.lang.Class<?> targetClass)
Convert the suppliedsource
object into the suppliedtargetType
.-
Methods inherited from class org.junit.jupiter.params.converter.SimpleArgumentConverter
convert
-
-
-
-
Method Detail
-
accept
public void accept(JavaTimeConversionPattern annotation)
- Specified by:
accept
in interfacejava.util.function.Consumer<JavaTimeConversionPattern>
-
convert
public java.lang.Object convert(java.lang.Object input, java.lang.Class<?> targetClass) throws ArgumentConversionException
Description copied from class:SimpleArgumentConverter
Convert the suppliedsource
object into the suppliedtargetType
.- Specified by:
convert
in classSimpleArgumentConverter
- Parameters:
input
- the source object to convert; may benull
targetClass
- the target type the source object should be converted into; nevernull
- Returns:
- the converted object; may be
null
but only if the target type is a reference type - Throws:
ArgumentConversionException
- in case an error occurs during the conversion
-
-