| 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 | Method and Description |
|---|---|
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 @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.and(@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate)
Returns the conjunction of this predicate with the given predicate.
|
static <INPUT,EXCEPTION extends Exception> |
FailablePredicate.and(@Nonnull FiniteIterable<? extends FailablePredicate<? super INPUT,? extends EXCEPTION>> predicates)
Returns the conjunction of the given predicates.
|
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.
|
default @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.negate()
Returns the negation of this predicate.
|
static <INPUT,EXCEPTION extends Exception> |
FailablePredicate.or(FailablePredicate<? super INPUT,? extends EXCEPTION>... predicates)
Returns the disjunction of the given predicates.
|
default @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.or(@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate)
Returns the disjunction of this predicate with the given predicate.
|
static <INPUT,EXCEPTION extends Exception> |
FailablePredicate.or(@Nonnull FiniteIterable<? extends FailablePredicate<? super INPUT,? extends EXCEPTION>> predicates)
Returns the disjunction of the given predicates.
|
default @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.replaceNull(boolean defaultValue)
Returns a new predicate based on this predicate that returns the given default value for null.
|
| Modifier and Type | Method and Description |
|---|---|
default @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.and(@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate)
Returns the conjunction of this predicate with the given predicate.
|
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,EXCEPTION extends Exception> |
FailablePredicate.or(FailablePredicate<? super INPUT,? extends EXCEPTION>... predicates)
Returns the disjunction of the given predicates.
|
default @Nonnull FailablePredicate<INPUT,EXCEPTION> |
FailablePredicate.or(@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate)
Returns the disjunction of this predicate with the given predicate.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
Predicate<INPUT>
This functional interface models a predicate that evaluates whether an object of type
INPUT satisfies a condition. |
| Modifier and Type | Method and Description |
|---|---|
default @Nonnull InfiniteIterable<ELEMENT> |
InfiniteIterable.filter(@Nonnull FailablePredicate<? super ELEMENT,?> predicate) |
default @Nonnull FiniteIterable<ELEMENT> |
FiniteIterable.filter(@Nonnull FailablePredicate<? super ELEMENT,?> predicate) |
@Nonnull FunctionalIterable<ELEMENT> |
FunctionalIterable.filter(@Nonnull FailablePredicate<? super ELEMENT,?> predicate)
Returns the elements of this iterable that satisfy the given predicate.
|
default @Nonnull InfiniteIterable<ELEMENT> |
InfiniteIterable.filterNot(@Nonnull FailablePredicate<? super ELEMENT,?> predicate) |
default @Nonnull FiniteIterable<ELEMENT> |
FiniteIterable.filterNot(@Nonnull FailablePredicate<? super ELEMENT,?> predicate) |
@Nonnull FunctionalIterable<ELEMENT> |
FunctionalIterable.filterNot(@Nonnull FailablePredicate<? super ELEMENT,?> predicate)
Returns the elements of this iterable that do not satisfy the given predicate.
|
default <EXCEPTION extends Exception> |
FiniteIterable.findFirst(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns the first element of this iterable that fulfills the given predicate or null if no such element is found.
|
default <EXCEPTION extends Exception> |
FiniteIterable.findFirst(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate,
ELEMENT defaultElement)
Returns the first element of this iterable that fulfills the given predicate or the given default element if no such element is found.
|
default <EXCEPTION extends Exception> |
FiniteIterable.findLast(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns the last element of this iterable that fulfills the given predicate or null if no such element is found.
|
default <EXCEPTION extends Exception> |
FiniteIterable.findLast(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate,
ELEMENT defaultElement)
Returns the last element of this iterable that fulfills the given predicate or the given default element if no such element is found.
|
default <EXCEPTION extends Exception> |
FiniteIterable.findUnique(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns the unique element of this iterable that fulfills the given predicate.
|
default <EXCEPTION extends Exception> |
FiniteIterable.matchAll(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns whether all elements of this iterable match the given predicate.
|
default <EXCEPTION extends Exception> |
FiniteIterable.matchAny(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns whether any elements of this iterable match the given predicate.
|
default <EXCEPTION extends Exception> |
FiniteIterable.matchNone(@Nonnull FailablePredicate<? super ELEMENT,? extends EXCEPTION> predicate)
Returns whether no element of this iterable matches the given predicate.
|
| Modifier and Type | Field and Description |
|---|---|
protected @Nonnull FailablePredicate<? super ELEMENT,?> |
FilteringIterator.predicate |
| Modifier and Type | Method and Description |
|---|---|
static <ELEMENT> @Nonnull FilteringIterator<ELEMENT> |
FilteringIterator.with(@Nonnull Iterator<? extends ELEMENT> iterator,
@Nonnull FailablePredicate<? super ELEMENT,?> predicate)
Returns a new filtering iterator that iterates over the elements of the given iterator that fulfill the given predicate.
|
| Constructor and Description |
|---|
FilteringIterator(@Nonnull Iterator<? extends ELEMENT> primaryIterator,
@Nonnull FailablePredicate<? super ELEMENT,?> predicate) |
| Modifier and Type | Method and Description |
|---|---|
static <INPUT,EXCEPTION extends Exception> |
Evaluate.predicateIfNotNull(INPUT input,
@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate)
Evaluates the given predicate for the given input if it is not null or returns false otherwise.
|
static <INPUT,EXCEPTION extends Exception> |
Evaluate.predicateIfNotNull(INPUT input,
@Nonnull FailablePredicate<? super INPUT,? extends EXCEPTION> predicate,
boolean defaultOutput)
Evaluates the given predicate for the given input if it is not null or returns the given default output otherwise.
|
Copyright © 2017. All rights reserved.