Class StringToCommonJavaTypesConverter
- java.lang.Object
-
- org.junit.jupiter.params.converter.StringToCommonJavaTypesConverter
-
- All Implemented Interfaces:
StringToObjectConverter
class StringToCommonJavaTypesConverter extends java.lang.Object implements StringToObjectConverter
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<java.lang.Class<?>,java.util.function.Function<java.lang.String,?>>CONVERTERS
-
Constructor Summary
Constructors Constructor Description StringToCommonJavaTypesConverter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvert(java.lang.Class<?> targetType)Determine if this converter can convert from aStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).java.lang.Objectconvert(java.lang.String source, java.lang.Class<?> targetType)Convert the suppliedStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).private static java.net.URLtoURL(java.lang.String url)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.junit.jupiter.params.converter.StringToObjectConverter
convert
-
-
-
-
Method Detail
-
canConvert
public boolean canConvert(java.lang.Class<?> targetType)
Description copied from interface:StringToObjectConverterDetermine if this converter can convert from aStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).- Specified by:
canConvertin interfaceStringToObjectConverter
-
convert
public java.lang.Object convert(java.lang.String source, java.lang.Class<?> targetType) throws java.lang.ExceptionDescription copied from interface:StringToObjectConverterConvert the suppliedStringto the supplied target type (which is guaranteed to be a wrapper type for primitives — for example,Integerinstead ofint).- Specified by:
convertin interfaceStringToObjectConverter- Throws:
java.lang.Exception
-
toURL
private static java.net.URL toURL(java.lang.String url)
-
-