Interface Slice<T>

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Slice<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    each(T part, boolean last)
    Possible question: why it returns boolean to continue slicing? Sometimes we may need to stop slicing once a certain data is received, in such case it will be a great optimization.
  • Method Details

    • each

      boolean each(T part, boolean last)
      Possible question: why it returns boolean to continue slicing? Sometimes we may need to stop slicing once a certain data is received, in such case it will be a great optimization.
      Parameters:
      part - each part in the when slicing.
      last - true if the part is the last part.
      Returns:
      false to break slicing or true to go on.
      Since:
      3.0.1