Interface CheckedConsumer<T>

Type Parameters:
T - the type consumed
All Superinterfaces:
Consumer<T>

public interface CheckedConsumer<T> extends Consumer<T>
A consumer interface that automatically wraps any exceptions.
Author:
Ramsey Gurley
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    accept(T t)
     
    void
    Same as accept except Exceptions may be thrown.

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • accept

      default void accept(T t)
      Specified by:
      accept in interface Consumer<T>
    • accepts

      void accepts(T t) throws Exception
      Same as accept except Exceptions may be thrown.
      Parameters:
      t - the accepted type
      Throws:
      Exception - an exception