Module org.junit.jupiter.params
Interface StringToObjectConverter
- All Known Implementing Classes:
FallbackStringToObjectConverter,StringToBooleanConverter,StringToCharacterConverter,StringToClassConverter,StringToCommonJavaTypesConverter,StringToEnumConverter,StringToJavaTimeConverter,StringToNumberConverter
interface StringToObjectConverter
Internal API for converting arguments of type
String to a specified
target type.-
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class<?> targetType) default Objectconvert(String source, Class<?> targetType, ClassLoader classLoader)
-
Method Details
-
canConvert
-
convert
Convert the suppliedStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).- Throws:
Exception
-
convert
default Object convert(String source, Class<?> targetType, ClassLoader classLoader) throws Exception Convert the suppliedStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).The default implementation simply delegates to
convert(String, Class). Can be overridden by concrete implementations of this interface that need access to the suppliedClassLoader.- Throws:
Exception
-