Interface Consumer<T>

Type Parameters:
T - the input type
All Known Subinterfaces:
Stream.Builder<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 Consumer<T>
An operation on one value that answers nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(T t)
    Performs this operation on t.
    default Consumer<T>
    andThen(Consumer<? super T> after)
    This operation followed by after, both given the same value.
  • Method Details

    • accept

      void accept(T t)
      Performs this operation on t.
      Parameters:
      t - the input
    • andThen

      default Consumer<T> andThen(Consumer<? super T> after)
      This operation followed by after, both given the same value. If this operation throws, after does not run.
      Parameters:
      after - the operation to run next
      Returns:
      the composed operation