Interface StringUtils.TwoPartSplitResult

Enclosing class:
StringUtils

@API(status=INTERNAL, since="1.11") public static interface StringUtils.TwoPartSplitResult
The result of splitting a string into up to two parts.
Since:
1.11
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    map(Function<String,? extends T> onePartMapper, BiFunction<String,String,? extends T> twoPartsMapper)
    Maps 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)
    Maps 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)
      Maps 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 part
      twoPartsMapper - 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)
      Maps 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 part
      twoPartsMapper - the mapper to use if the string was split into two parts