Class CloseSilentlyAsyncFunction<VIN extends Closeable,​VOUT,​E extends Exception>

  • Type Parameters:
    VIN - The type of the async function input-parameter, which implements Closeable.
    VOUT - The type of the async function result, or Void if the async function does not return anything (i.e. it only has side-effects).
    E - The type of the exception thrown by the async function, or NeverThrowsException if no exception is thrown by the function.
    All Implemented Interfaces:
    AsyncFunction<VIN,​VOUT,​E>

    public final class CloseSilentlyAsyncFunction<VIN extends Closeable,​VOUT,​E extends Exception>
    extends Object
    implements AsyncFunction<VIN,​VOUT,​E>
    AsyncFunction that silently closes an input-parameter after a delegate-function's AsyncFunction.apply(Object) is completed.
    • Method Detail

      • closeSilently

        public static <IN extends Closeable,​OUT,​EX extends ExceptionAsyncFunction<IN,​OUT,​EX> closeSilently​(AsyncFunction<IN,​OUT,​EX> delegate)
        Wraps a delegate asynchronous function in a CloseSilentlyAsyncFunction.
        Type Parameters:
        IN - The type of the asynchronous function input-parameter, which implements Closeable.
        OUT - The type of the function result, or Void if the async function does not return anything (i.e. it only has side-effects).
        EX - The type of the exception thrown by the async function, or NeverThrowsException if no exception is thrown by the function.
        Parameters:
        delegate - Delegate asynchronous function.
        Returns:
        New CloseSilentlyAsyncFunction instance.