| 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.iterables |
Provides iterables with functional methods.
|
| net.digitalid.utility.functional.iterators |
Provides the iterators for the functional iterables.
|
| net.digitalid.utility.functional.nullable |
Provides utility classes for handling nullable objects.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
FailableUnaryOperator<TYPE,EXCEPTION extends Exception>
This functional interface models a failable unary operator that maps an object of type
TYPE to another object of type TYPE. |
| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT> |
FailableUnaryFunction.after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function followed by this function.
|
default @Nonnull FailableUnaryFunction<INPUT,Boolean,EXCEPTION> |
FailablePredicate.asFunction()
Returns this predicate as a unary function.
|
default @Nonnull FailableUnaryFunction<Object,OUTPUT,EXCEPTION> |
FailableProducer.asFunction()
Returns this producer as a unary function that ignores its input.
|
default @Nonnull FailableUnaryFunction<INPUT,Void,EXCEPTION> |
FailableConsumer.asFunction()
Returns this consumer as a unary function that always returns null.
|
default <FINAL_OUTPUT> |
FailableUnaryFunction.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> |
FailableUnaryFunction.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.
|
default @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> |
FailableUnaryFunction.propagateNull()
Returns a new function based on this function that propagates null instead of evaluating it.
|
default @Nonnull FailableUnaryFunction<INPUT,OUTPUT,EXCEPTION> |
FailableUnaryFunction.replaceNull(OUTPUT defaultOutput)
Returns a new function based on this function that returns the given default output for null.
|
| Modifier and Type | Method and Description |
|---|---|
default <INITIAL_INPUT> |
FailableUnaryFunction.after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function followed by this function.
|
default <INITIAL_INPUT> |
FailablePredicate.after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function followed by this predicate.
|
default <INITIAL_INPUT> |
FailableConsumer.after(@Nonnull FailableUnaryFunction<? super INITIAL_INPUT,? extends INPUT,? extends EXCEPTION> function)
Returns the composition of the given function followed by this consumer.
|
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 <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> |
FailableUnaryFunction.before(@Nonnull FailableUnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT,? extends EXCEPTION> function)
Returns the composition of this function followed by the given function.
|
default <FINAL_OUTPUT> |
FailableProducer.before(@Nonnull FailableUnaryFunction<? super OUTPUT,? extends FINAL_OUTPUT,? extends EXCEPTION> function)
Returns the composition of this producer followed by the given 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 <INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
FailableProducer.compose(@Nonnull FailableProducer<? extends INTERMEDIATE,? extends EXCEPTION> producer,
@Nonnull FailableUnaryFunction<? super INTERMEDIATE,? extends OUTPUT,? extends EXCEPTION> function)
Returns the composition of the given producer and function with a flexible exception type.
|
static <INPUT,INTERMEDIATE,EXCEPTION extends Exception> |
FailablePredicate.compose(@Nonnull FailableUnaryFunction<? super INPUT,? extends INTERMEDIATE,? extends EXCEPTION> function,
@Nonnull FailablePredicate<? super INTERMEDIATE,? extends EXCEPTION> predicate)
Returns the composition of the given function and predicate with a flexible exception type.
|
static <INPUT,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
FailableUnaryFunction.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.
|
static <INPUT,INTERMEDIATE,OUTPUT,EXCEPTION extends Exception> |
FailableUnaryFunction.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.
|
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.
|
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 |
UnaryFunction<INPUT,OUTPUT>
This functional interface models a unary function that maps an object of type
INPUT to an object of type OUTPUT. |
interface |
UnaryOperator<TYPE>
This functional interface models a unary operator that maps an object of type
TYPE to another object of type TYPE. |
| Modifier and Type | Method and Description |
|---|---|
default <KEY,EXCEPTION extends Exception> |
FiniteIterable.groupBy(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends KEY,? extends EXCEPTION> function)
Returns the elements of this iterable as a map grouped by the given function.
|
default <TYPE> @Nonnull InfiniteIterable<TYPE> |
InfiniteIterable.map(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends TYPE,?> function) |
default <TYPE> @Nonnull FiniteIterable<TYPE> |
FiniteIterable.map(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends TYPE,?> function) |
<TYPE> @Nonnull FunctionalIterable<TYPE> |
FunctionalIterable.map(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends TYPE,?> function)
Returns the elements of this iterable mapped by the given function.
|
default <KEY,EXCEPTION extends Exception> |
FiniteIterable.toMap(@Nonnull FailableUnaryFunction<? super ELEMENT,? extends KEY,? extends EXCEPTION> function)
Returns the elements of this iterable as a map with their key determined by the given function.
|
| Modifier and Type | Field and Description |
|---|---|
protected @Nonnull FailableUnaryFunction<? super INPUT,? extends OUTPUT,?> |
MappingIterator.function |
| Modifier and Type | Method and Description |
|---|---|
static <OUTPUT,INPUT> |
MappingIterator.with(@Nonnull Iterator<INPUT> iterator,
@Nonnull FailableUnaryFunction<? super INPUT,? extends OUTPUT,?> function)
Returns a new mapping iterator that iterates over the elements of the given iterator mapped by the given function.
|
| Constructor and Description |
|---|
MappingIterator(@Nonnull Iterator<INPUT> primaryIterator,
@Nonnull FailableUnaryFunction<? super INPUT,? extends OUTPUT,?> function) |
| Modifier and Type | Method and Description |
|---|---|
static <INPUT,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfNotNull(INPUT input,
@Nonnull FailableUnaryFunction<? super INPUT,? extends OUTPUT,? extends EXCEPTION> function)
Evaluates the given function for the given input if it is not null or propagates null otherwise.
|
static <INPUT,OUTPUT,EXCEPTION extends Exception> |
Evaluate.functionIfNotNull(INPUT input,
@Nonnull FailableUnaryFunction<? super INPUT,? extends OUTPUT,? extends EXCEPTION> function,
OUTPUT defaultOutput)
Evaluates the given function for the given input if it is not null or returns the given default output otherwise.
|
Copyright © 2017. All rights reserved.