Interface Consumer<T>

Type Parameters:
T - The type of the function input.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@ConsumerType @FunctionalInterface public interface Consumer<T>
A function that accepts a single argument and produces no result.

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

Since:
1.1
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(T t)
    Applies this function to the specified argument.
  • Method Details

    • accept

      void accept(T t) throws Exception
      Applies this function to the specified argument.
      Parameters:
      t - The input to this function.
      Throws:
      Exception - An exception thrown by the method.