@Immutable
@Functional
public interface FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION extends Exception>
INPUT to an object of type OUTPUT.| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT> |
after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function 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 <INPUT,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
compose(@Nonnull FailableUnaryFunction<? super INPUT,? extends INTERMEDIATE,? extends EXCEPTION> function0,
@Nonnull FailableUnaryFunction<? super INTERMEDIATE,? extends OUTPUT,? extends EXCEPTION> function1)
Returns the composition of the given functions with a flexible exception type.
|
OUTPUT |
evaluate(INPUT input)
Evaluates this function for the given object.
|
default @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> |
propagateNull()
Returns a new function based on this function that propagates null instead of evaluating it.
|
default @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> |
replaceNull(OUTPUT defaultOutput)
Returns a new function based on this function that returns the given default output for null.
|
default @Nonnull UnaryFunction<INPUT,OUTPUT> |
suppressExceptions()
Returns a function that suppresses the exceptions of this function and returns null instead.
|
default @Nonnull UnaryFunction<INPUT,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 UnaryFunction<INPUT,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 UnaryFunction<INPUT,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 INPUT input) throws EXCEPTION extends Exception
@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> suppressExceptions(@Captured @Nonnull @Nonnull Consumer<? super Exception> handler, @Captured OUTPUT defaultOutput)
@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> suppressExceptions(@Captured @Nonnull @Nonnull Consumer<? super Exception> handler)
@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> suppressExceptions(@Captured OUTPUT defaultOutput)
@Pure @Nonnull default @Nonnull UnaryFunction<INPUT,OUTPUT> suppressExceptions()
@Pure @Nonnull static <INPUT,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> compose(@Nonnull @Nonnull FailableUnaryFunction<? super INPUT,? extends INTERMEDIATE,? extends EXCEPTION> function0, @Nonnull @Nonnull FailableUnaryFunction<? super INTERMEDIATE,? extends OUTPUT,? extends EXCEPTION> function1)
@Pure @Nonnull default <FINAL_OUTPUT> @Nonnull FailableUnaryFunction<INPUT,FINAL_OUTPUT,EXCEPTION> before(@Nonnull @Nonnull FailableUnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT,? extends EXCEPTION> function)
@Pure @Nonnull default <INITIAL_INPUT> @Nonnull FailableUnaryFunction<INITIAL_INPUT,OUTPUT,EXCEPTION> after(@Nonnull @Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
@Pure @Nonnull default @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> replaceNull(@Captured OUTPUT defaultOutput)
Copyright © 2017. All rights reserved.