Interface StringSplitter.Async

All Superinterfaces:
Function<String,List<String>>, StringSplitter
All Known Implementing Classes:
StringSplitter.Shell
Enclosing interface:
StringSplitter

public static interface StringSplitter.Async extends StringSplitter
A splitter that is capable of processing the split in an asynchronous manner.
Since:
1.0
Version:
1.0
  • Method Details

    • takeNext

      String takeNext(String state, Consumer<String> sink)
      Takes the next element from the current state.
      Parameters:
      state - The current processing state.
      sink - The sink to send the next element into.
      Returns:
      The new state.
    • split

      default List<String> split(String raw)
      Description copied from interface: StringSplitter
      Splits the given string into components.
      Specified by:
      split in interface StringSplitter
      Parameters:
      raw - The string to split.
      Returns:
      The split components.
    • splitAsync

      @SideEffectFree default Flux<String> splitAsync(String raw)
      Splits the given string into components. Splitting is performed asynchronously as requests are received from downstream.
      Parameters:
      raw - The string to split.
      Returns:
      The split components.
    • iterate

      default StringSplitter.Async.Iterator iterate(String raw)
      Description copied from interface: StringSplitter
      Creates a smart iterator that iterates over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to calling SmartIterator.from(List) on the result of StringSplitter.split(String), but may (depending on implementation) split components lazily on demand.
      Specified by:
      iterate in interface StringSplitter
      Parameters:
      raw - The string to split.
      Returns:
      A smart iterator over the split components.
    • spliterate

      @SideEffectFree default Spliterator<String> spliterate(String raw)
      Creates a spliterator that iterates over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to calling List.spliterator() on the result of split(String), but splits components lazily on demand.
      Parameters:
      raw - The string to split.
      Returns:
      A spliterator over the split components.
    • splitStream

      @SideEffectFree default Stream<String> splitStream(String raw)
      Creates a stream that contains over the components obtained by splitting the given raw string. The returned iterator is functionally equivalent to calling Collection.stream() on the result of split(String), but splits components lazily on demand.
      Parameters:
      raw - The string to split.
      Returns:
      A stream of the split components.
    • emptyIterator

      default StringSplitter.Async.Iterator emptyIterator()
      Creates an empty iterator for this splitter.
      Specified by:
      emptyIterator in interface StringSplitter
      Returns:
      The iterator.