Interface Streamer<E>

Type Parameters:
E - The type of contained elements.
All Superinterfaces:
Streamable<E>
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 Streamer<E> extends Streamable<E>
Represents a Streamable type that provides a kind of builder pattern.
  • Method Details

    • empty

      static <E> Streamer<E> empty()
      Returns a Streamer that is empty.
      Type Parameters:
      E - The type of virtually contained elements.
    • of

      static <E> Streamer<E> of(E element)
      Returns a Streamer that contains a single given element.
      Type Parameters:
      E - The type of the contained element.
    • of

      @SafeVarargs static <E> Streamer<E> of(E element0, E element1, E... more)
      Returns a Streamer that contains two or more given elements.
      Type Parameters:
      E - The type of the contained elements.
    • of

      static <E> Streamer<E> of(E[] elements)
      Returns a Streamer backed by an array of elements.
      Type Parameters:
      E - The type of the contained elements.
    • of

      static <E> Streamer<E> of(Iterable<E> iterable)
      Returns a Streamer backed by a given Iterable.
      Type Parameters:
      E - The type of the contained elements.
    • by

      static <E> Streamer<E> by(Streamable<E> streamable)
      Returns a Streamer backed by a given Streamable.
      Type Parameters:
      E - The type of the contained elements.
    • concat

      static <E, F extends E, G extends E> Streamer<E> concat(Streamable<F> left, Streamable<G> right)
      Returns a concatenated Streamer whose elements are all the elements of the left argument followed by all the elements of the right argument. The result has a streaming order if both of the arguments have a streaming order.
      Type Parameters:
      E - The element type of the resulting Streamer.
      F - The element type of the left argument.
      G - The element type of the right argument.
      Throws:
      NullPointerException - if one of the arguments is null.
    • add

      default Streamer<E> add(E element)
      Returns a concatenated Streamer whose elements are all the elements of this followed by the given element. The result has a streaming order if this has a streaming order.
    • addAll

      default <X extends E> Streamer<E> addAll(Streamable<X> other)
      Returns a concatenated Streamer whose elements are all the elements of this followed by all the elements of the other Streamer. The result has a streaming order if both, this and other, have a streaming order.
      Type Parameters:
      X - The element type of the other Streamer.
      Throws:
      NullPointerException - if other is null.
    • remove

      default Streamer<E> remove(Object candidate)
      Returns a Streamer consisting of the elements of this but not the given candidate.
    • removeAll

      default <X> Streamer<E> removeAll(Streamable<X> other)
      Returns a Streamer consisting of the elements of this that are not contained in the other Streamer.
      Throws:
      NullPointerException - if the specified other Streamer is null.
    • removeIf

      default Streamer<E> removeIf(Predicate<? super E> condition)
      Returns a Streamer consisting of the elements of this for which condition.test(element) is false.
      Throws:
      NullPointerException - if the specified condition is null.
    • retainAll

      default <X> Streamer<E> retainAll(Streamable<X> other)
      Returns a Streamer consisting of the elements of this that are contained in the other Streamer.
      Throws:
      NullPointerException - if the specified other Streamer is null.
    • retainIf

      default Streamer<E> retainIf(Predicate<? super E> condition)
      Returns a Streamer consisting of the elements of this for which condition.test(element) is true.
      Throws:
      NullPointerException - if the specified condition is null.