Package org.junit.platform.commons.util
Interface StringUtils.TwoPartSplitResult
-
- Enclosing class:
- StringUtils
@API(status=INTERNAL, since="1.11") public static interface StringUtils.TwoPartSplitResultThe result of splitting a string into up to two parts.- Since:
- 1.11
- See Also:
StringUtils.splitIntoTwo(char, String),StringUtils.splitIntoTwo(String, String)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> Tmap(java.util.function.Function<java.lang.String,? extends T> onePartMapper, java.util.function.BiFunction<java.lang.String,java.lang.String,? extends T> twoPartsMapper)Map the result of splitting a string into up to two parts.default <T> TmapTwo(java.util.function.Supplier<? extends java.lang.RuntimeException> onePartExceptionCreator, java.util.function.BiFunction<java.lang.String,java.lang.String,? extends T> twoPartsMapper)Map the result of splitting a string into two parts or throw an exception.
-
-
-
Method Detail
-
mapTwo
default <T> T mapTwo(java.util.function.Supplier<? extends java.lang.RuntimeException> onePartExceptionCreator, java.util.function.BiFunction<java.lang.String,java.lang.String,? extends T> twoPartsMapper)Map the result of splitting a string into two parts or throw an exception.- Parameters:
onePartExceptionCreator- the exception creator to use if the string was split into a single parttwoPartsMapper- the mapper to use if the string was split into two parts
-
map
<T> T map(java.util.function.Function<java.lang.String,? extends T> onePartMapper, java.util.function.BiFunction<java.lang.String,java.lang.String,? extends T> twoPartsMapper)Map the result of splitting a string into up to two parts.- Parameters:
onePartMapper- the mapper to use if the string was split into a single parttwoPartsMapper- the mapper to use if the string was split into two parts
-
-