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

net.florianschoppmann.java.futures.CheckedBiConsumer Maven / Gradle / Ivy

Go to download

Bridge gaps and help overcome inconveniences with CompletableFuture. This module includes, among other features, methods to collect the results of multiple futures into a list, provides equivalent alternatives to CompletableFuture’s monadic methods (thenApply, thenCompose, etc.) that can deal with checked exceptions, and methods for asynchronous “try-with-resources” constructs.

The newest version!
package net.florianschoppmann.java.futures;

import javax.annotation.Nullable;

/**
 * Represents an operation that accepts two input arguments and returns no result. Unlike most other functional
 * interfaces, {@code CheckedBiConsumer} is expected to operate via side-effects.
 *
 * 

This is a functional interface whose functional method is {@link #checkedAccept(Object, Object)}. It is similar to * {@link java.util.function.BiConsumer}, except that the functional method may throw a checked exception. * * @param the type of the first argument to the operation * @param the type of the second argument to the operation * * @see java.util.function.BiConsumer */ @FunctionalInterface public interface CheckedBiConsumer { /** * Performs this operation on the given arguments. * * @param first the first input argument * @param second the second input argument * @throws Exception if unable to process the input */ void checkedAccept(@Nullable T first, @Nullable U second) throws Exception; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy