Class FallbackStringToObjectConverter

java.lang.Object
org.junit.jupiter.params.converter.FallbackStringToObjectConverter
All Implemented Interfaces:
DefaultArgumentConverter.StringToObjectConverter

class FallbackStringToObjectConverter extends Object implements DefaultArgumentConverter.StringToObjectConverter
FallbackStringToObjectConverter is a DefaultArgumentConverter.StringToObjectConverter that provides a fallback conversion strategy for converting from a String to a given target type by invoking a static factory method or factory constructor defined in the target type.

Search Algorithm

  1. Search for a single, non-private static factory method in the target type that converts from a String to the target type. Use the factory method if present.
  2. Search for a single, non-private constructor in the target type that accepts a String. Use the constructor if present.

If multiple suitable factory methods are discovered they will be ignored. If neither a single factory method nor a single constructor is found, this converter acts as a no-op.

Since:
5.1
See Also: