All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.igormaznitsa.meta.common.interfaces.CheckedConsumer Maven / Gradle / Ivy

The newest version!
package com.igormaznitsa.meta.common.interfaces;

import static java.util.Objects.requireNonNull;

/**
 * Consumer allows throw checked exception.
 *
 * @param  type of argument
 * @since 1.2.1
 */
@FunctionalInterface
public interface CheckedConsumer {

  default CheckedConsumer andThen(CheckedConsumer after) {
    requireNonNull(after);
    return (T t) -> {
      accept(t);
      after.accept(t);
    };
  }

  void accept(T t) throws Exception;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy