| Package | Description |
|---|---|
| net.digitalid.utility.functional.failable |
Provides failable interfaces for functional programming.
|
| net.digitalid.utility.functional.interfaces |
Provides interfaces for functional programming.
|
| net.digitalid.utility.functional.nullable |
Provides utility classes for handling nullable objects.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
FailableBinaryOperator<TYPE,EXCEPTION extends Exception>
This functional interface models a failable binary operator that maps two objects of type
TYPE to another object of type TYPE. |
| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT0,INITIAL_INPUT1> |
FailableBinaryFunction.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> |
FailableBinaryFunction.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> |
FailableBinaryFunction.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> |
FailableBinaryFunction.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.
|
default @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> |
FailableBinaryFunction.propagateNull()
Returns a new function based on this function that propagates null instead of evaluating it.
|
default @Nonnull FailableBinaryFunction<INPUT0,INPUT1,OUTPUT,EXCEPTION> |
FailableBinaryFunction.replaceNull(OUTPUT defaultOutput)
Returns a new function based on this function that returns the given default output if either input is null.
|
| Modifier and Type | Method and Description |
|---|---|
static <INPUT0,INPUT1,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
FailableBinaryFunction.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> |
FailableBinaryFunction.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.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
BinaryFunction<INPUT0,INPUT1,OUTPUT>
This functional interface models a binary function that maps an object of type
INPUT0 and an object of type INPUT1 to an object of type OUTPUT. |
interface |
BinaryOperator<TYPE>
This functional interface models a binary operator that maps two objects of type
TYPE to another object of type TYPE. |
| Modifier and Type | Method and Description |
|---|---|
static <INPUT0,INPUT1,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfBothNotNull(INPUT0 input0,
INPUT1 input1,
@Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends OUTPUT,? extends EXCEPTION> function)
Evaluates the given function for the given inputs if both inputs are not null or propagates null otherwise.
|
static <INPUT0,INPUT1,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfBothNotNull(INPUT0 input0,
INPUT1 input1,
@Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends OUTPUT,? extends EXCEPTION> function,
OUTPUT defaultOutput)
Evaluates the given function for the given inputs if both inputs are not null or returns the given default output otherwise.
|
static <INPUT0,INPUT1,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfFirstNotNull(INPUT0 input0,
INPUT1 input1,
@Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends OUTPUT,? extends EXCEPTION> function)
Evaluates the given function for the given inputs if the first input is not null or propagates null otherwise.
|
static <INPUT0,INPUT1,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfFirstNotNull(INPUT0 input0,
INPUT1 input1,
@Nonnull FailableBinaryFunction<? super INPUT0,? super INPUT1,? extends OUTPUT,? extends EXCEPTION> function,
OUTPUT defaultOutput)
Evaluates the given function for the given inputs if the first input is not null or returns the given default output otherwise.
|
Copyright © 2017. All rights reserved.