Module org.junit.platform.commons
Package org.junit.platform.commons.util
Interface StringUtils.TwoPartSplitResult
- Enclosing class:
StringUtils
The result of splitting a string into up to two parts.
- Since:
- 1.11
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> T
map
(Function<String, ? extends T> onePartMapper, BiFunction<String, String, ? extends T> twoPartsMapper) Map the result of splitting a string into up to two parts.default <T> T
mapTwo
(Supplier<? extends RuntimeException> onePartExceptionCreator, BiFunction<String, String, ? extends T> twoPartsMapper) Map the result of splitting a string into two parts or throw an exception.
-
Method Details
-
mapTwo
default <T> T mapTwo(Supplier<? extends RuntimeException> onePartExceptionCreator, BiFunction<String, 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(Function<String, ? extends T> onePartMapper, BiFunction<String, 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
-