@Immutable
@Functional
public interface FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION extends Exception>
INPUT0 and an object of type INPUT1 to an object of type OUTPUT.| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT0,INITIAL_INPUT1> |
after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT0,? extends INPUT0,? extends EXCEPTION> function0,
@Nonnull FailableUnaryFunction<? super INITIAL_INPUT1,? extends INPUT1,? extends EXCEPTION> function1)
Returns the composition of the given functions followed by this function.
|
default <FINAL_OUTPUT> |
before(@Nonnull FailableUnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT,? extends EXCEPTION> function)
Returns the composition of this function followed by the given function.
|
static <INPUT0,INPUT1,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
compose(@Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends INTERMEDIATE,? extends EXCEPTION> binaryFunction,
@Nonnull FailableUnaryFunction<? super INTERMEDIATE,? extends OUTPUT,? extends EXCEPTION> unaryFunction)
Returns the composition of the given functions with a flexible exception type.
|
static <INPUT0,INPUT1,INTERMEDIATE0,INTERMEDIATE1,OUTPUT,EXCEPTION extends Exception> |
compose(@Nonnull FailableUnaryFunction<? super INPUT0,? extends INTERMEDIATE0,? extends EXCEPTION> unaryFunction0,
@Nonnull FailableUnaryFunction<? super INPUT1,? extends INTERMEDIATE1,? extends EXCEPTION> unaryFunction1,
@Nonnull FailableBinaryFunction<? super INTERMEDIATE0,? super INTERMEDIATE1,? extends OUTPUT,? extends EXCEPTION> binaryFunction)
Returns the composition of the given functions with a flexible exception type.
|
OUTPUT |
evaluate(INPUT0 input0,
INPUT1 input1)
Evaluates this function for the given objects.
|
default OUTPUT |
evaluate(@Nonnull Pair<INPUT0,INPUT1> pair)
Evaluates this function for the objects in the given pair.
|
default @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> |
propagateNull()
Returns a new function based on this function that propagates null instead of evaluating it.
|
default @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> |
replaceNull(OUTPUT defaultOutput)
Returns a new function based on this function that returns the given default output if either input is null.
|
default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> |
suppressExceptions()
Returns a function that suppresses the exceptions of this function and returns null instead.
|
default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> |
suppressExceptions(@Nonnull Consumer<? super Exception> handler)
Returns a function that catches the exceptions of this function, passes them to the given exception handler and returns null instead.
|
default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> |
suppressExceptions(@Nonnull Consumer<? super Exception> handler,
OUTPUT defaultOutput)
Returns a function that catches the exceptions of this function, passes them to the given exception handler and returns the given default output instead.
|
default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> |
suppressExceptions(OUTPUT defaultOutput)
Returns a function that suppresses the exceptions of this function and returns the given default output instead.
|
@Pure OUTPUT evaluate(@NonCaptured @Unmodified INPUT0 input0, @NonCaptured @Unmodified INPUT1 input1) throws EXCEPTION extends Exception
@Pure default OUTPUT evaluate(@Nonnull @Nonnull Pair<INPUT0,INPUT1> pair) throws EXCEPTION extends Exception
@Pure @Nonnull default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> suppressExceptions(@Captured @Nonnull @Nonnull Consumer<? super Exception> handler, @Captured OUTPUT defaultOutput)
@Pure @Nonnull default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> suppressExceptions(@Captured @Nonnull @Nonnull Consumer<? super Exception> handler)
@Pure @Nonnull default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> suppressExceptions(@Captured OUTPUT defaultOutput)
@Pure @Nonnull default @Nonnull BinaryFunction<INPUT0,INPUT1,OUTPUT> suppressExceptions()
@Pure @Nonnull static <INPUT0,INPUT1,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> compose(@Nonnull @Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends INTERMEDIATE,? extends EXCEPTION> binaryFunction, @Nonnull @Nonnull FailableUnaryFunction<? super INTERMEDIATE,? extends OUTPUT,? extends EXCEPTION> unaryFunction)
@Pure @Nonnull default <FINAL_OUTPUT> @Nonnull FailableBinaryFunction<INPUT0,INPUT1,FINAL_OUTPUT,EXCEPTION> before(@Nonnull @Nonnull FailableUnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT,? extends EXCEPTION> function)
@Pure @Nonnull static <INPUT0,INPUT1,INTERMEDIATE0,INTERMEDIATE1,OUTPUT,EXCEPTION extends Exception> @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> compose(@Nonnull @Nonnull FailableUnaryFunction<? super INPUT0,? extends INTERMEDIATE0,? extends EXCEPTION> unaryFunction0, @Nonnull @Nonnull FailableUnaryFunction<? super INPUT1,? extends INTERMEDIATE1,? extends EXCEPTION> unaryFunction1, @Nonnull @Nonnull FailableBinaryFunction<? super INTERMEDIATE0,? super INTERMEDIATE1,? extends OUTPUT,? extends EXCEPTION> binaryFunction)
@Pure @Nonnull default <INITIAL_INPUT0,INITIAL_INPUT1> @Nonnull FailableBinaryFunction<INITIAL_INPUT0,INITIAL_INPUT1,OUTPUT,EXCEPTION> after(@Nonnull @Nonnull FailableUnaryFunction<? super INITIAL_INPUT0,? extends INPUT0,? extends EXCEPTION> function0, @Nonnull @Nonnull FailableUnaryFunction<? super INITIAL_INPUT1,? extends INPUT1,? extends EXCEPTION> function1)
@Pure @Nonnull default @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> replaceNull(@Captured OUTPUT defaultOutput)
Copyright © 2017. All rights reserved.