public final class XFunc extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XFunc.MaxInteger |
| Modifier and Type | Method and Description |
|---|---|
static <E,R> Aggregator<E,R> |
aggregator(BiConsumer<? super E,? super R> joiner,
R aggregate) |
static <T> Predicate<T> |
all()
Functional alias for
return true;. |
static <T> Predicate<T> |
all(Predicate<? super T>... predicates) |
static <T> Predicate<T> |
any()
Functional alias for
return true;. |
static <E> AggregateCount<E> |
count() |
static <E> Aggregator<E,Long> |
counter() |
static <E> Predicate<E> |
isEqual(E sample,
Equalator<? super E> equalator) |
static <T> Predicate<T> |
isEqualTo(T subject) |
static Predicate<Object> |
isInstanceOf(Class<?>... types) |
static Predicate<Object> |
isInstanceOf(Class<?> type) |
static <T> Predicate<T> |
isSameAs(T subject) |
static Aggregator<Integer,Integer> |
max(int initialValue) |
static <T> Predicate<T> |
none()
Functional alias for
return false;. |
static <E> void |
noOp(E e)
Literally a no-op
Consumer. |
static <T> Predicate<T> |
not(Predicate<T> predicate)
Fluent alias for
predicate.negate(). |
static Predicate<Object> |
notIsInstanceOf(Class<?>... types) |
static Predicate<Object> |
notIsInstanceOf(Class<?> type) |
static <T> Predicate<T> |
notNull()
Functional alias for
return e != null;. |
static <T> Predicate<T> |
one(Predicate<? super T>... predicates) |
static <T> Function<T,T> |
passThrough() |
static <T,E extends T> |
predicate(E subject,
Equalator<T> equalator) |
static <T> Predicate<T> |
select(Predicate<T> predicate)
Required to use lambdas or method reference in conjunction with
Predicate.and(Predicate) etc. |
static <T,R> Function<T,R> |
toNull() |
static <T extends R,R> |
upcast()
Pass-through function with type upcast.
|
static <I,O> Consumer<I> |
wrapWithFunction(Consumer<? super O> target,
Function<? super I,O> function) |
static <I,O> Consumer<I> |
wrapWithFunctionLimit(Consumer<? super O> target,
Function<? super I,O> function,
long limit) |
static <I,O> Consumer<I> |
wrapWithFunctionSkip(Consumer<? super O> target,
Function<? super I,O> function,
long skip) |
static <I,O> Consumer<I> |
wrapWithFunctionSkipLimit(Consumer<? super O> target,
Function<? super I,O> function,
long skip,
long limit) |
static <E> Consumer<E> |
wrapWithLimit(Consumer<? super E> target,
long limit) |
static <E> Consumer<E> |
wrapWithPredicate(Consumer<? super E> target,
Predicate<? super E> predicate) |
static <I,O> Consumer<I> |
wrapWithPredicateFunction(Consumer<? super O> target,
Predicate<? super I> predicate,
Function<? super I,O> function) |
static <I,O> Consumer<I> |
wrapWithPredicateFunctionLimit(Consumer<? super O> target,
Predicate<? super I> predicate,
Function<? super I,O> function,
long limit) |
static <I,O> Consumer<I> |
wrapWithPredicateFunctionSkip(Consumer<? super O> target,
Predicate<? super I> predicate,
Function<? super I,O> function,
long skip) |
static <I,O> Consumer<I> |
wrapWithPredicateFunctionSkipLimit(Consumer<? super O> target,
Predicate<? super I> predicate,
Function<? super I,O> function,
long skip,
long limit) |
static <E> Consumer<E> |
wrapWithPredicateLimit(Consumer<? super E> target,
Predicate<? super E> predicate,
long limit) |
static <E> Consumer<E> |
wrapWithPredicateSkip(Consumer<? super E> target,
Predicate<? super E> predicate,
long skip) |
static <E> Consumer<E> |
wrapWithPredicateSkipLimit(Consumer<? super E> target,
Predicate<? super E> predicate,
long skip,
long limit) |
static <E> Consumer<E> |
wrapWithSkip(Consumer<? super E> target,
long skip) |
static <E> Consumer<E> |
wrapWithSkipLimit(Consumer<? super E> target,
long skip,
long limit) |
public static final <T> Predicate<T> all()
return true;.T - the type of the input to the predicatepublic static final <T> Predicate<T> any()
return true;.T - the type of the input to the predicatepublic static final <T> Predicate<T> none()
return false;.T - the type of the input to the predicatepublic static <T> Predicate<T> notNull()
return e != null;.T - the type of the input to the predicatepublic static final <T,R> Function<T,R> toNull()
public static final <T> Function<T,T> passThrough()
public static <E> void noOp(E e)
Consumer.E - the type of the input to the operatione - the input, which is simply ignored@SafeVarargs public static final <T> Predicate<T> all(Predicate<? super T>... predicates)
public static final <T> Predicate<T> select(Predicate<T> predicate)
Predicate.and(Predicate) etc.T - the type of the input to the predicatepredicate - a predicate instance@SafeVarargs public static final <T> Predicate<T> one(Predicate<? super T>... predicates)
public static final <T> Predicate<T> isEqualTo(T subject)
public static final <T> Predicate<T> isSameAs(T subject)
public static final <T,E extends T> Predicate<T> predicate(E subject, Equalator<T> equalator)
public static <T> Predicate<T> not(Predicate<T> predicate)
predicate.negate().T - the type of the input to the predicatepredicate - the predicate to negatepublic static final Aggregator<Integer,Integer> max(int initialValue)
public static final <E> AggregateCount<E> count()
public static final <E,R> Aggregator<E,R> aggregator(BiConsumer<? super E,? super R> joiner, R aggregate)
public static <E> Aggregator<E,Long> counter()
public static <E> Consumer<E> wrapWithSkipLimit(Consumer<? super E> target, long skip, long limit)
public static final <E> Consumer<E> wrapWithPredicate(Consumer<? super E> target, Predicate<? super E> predicate)
public static <E> Consumer<E> wrapWithPredicateSkip(Consumer<? super E> target, Predicate<? super E> predicate, long skip)
public static <E> Consumer<E> wrapWithPredicateLimit(Consumer<? super E> target, Predicate<? super E> predicate, long limit)
public static <E> Consumer<E> wrapWithPredicateSkipLimit(Consumer<? super E> target, Predicate<? super E> predicate, long skip, long limit)
public static final <I,O> Consumer<I> wrapWithFunction(Consumer<? super O> target, Function<? super I,O> function)
public static <I,O> Consumer<I> wrapWithFunctionSkip(Consumer<? super O> target, Function<? super I,O> function, long skip)
public static <I,O> Consumer<I> wrapWithFunctionLimit(Consumer<? super O> target, Function<? super I,O> function, long limit)
public static <I,O> Consumer<I> wrapWithFunctionSkipLimit(Consumer<? super O> target, Function<? super I,O> function, long skip, long limit)
public static final <I,O> Consumer<I> wrapWithPredicateFunction(Consumer<? super O> target, Predicate<? super I> predicate, Function<? super I,O> function)
public static <I,O> Consumer<I> wrapWithPredicateFunctionSkip(Consumer<? super O> target, Predicate<? super I> predicate, Function<? super I,O> function, long skip)
public static <I,O> Consumer<I> wrapWithPredicateFunctionLimit(Consumer<? super O> target, Predicate<? super I> predicate, Function<? super I,O> function, long limit)
public static <I,O> Consumer<I> wrapWithPredicateFunctionSkipLimit(Consumer<? super O> target, Predicate<? super I> predicate, Function<? super I,O> function, long skip, long limit)
public static final <T extends R,R> Function<T,R> upcast()
Consider the following example with V1 extends V: (e.g. V is an interface and V1 is an implementation of V)
XMap<K, V1> workingCollection = ... ; XImmutableMap<K, V> finalCollection = ConstHashTable.NewProjected(input, <K>passthrough(), <V1, V>upcast());
T - the type of the input to the functionR - the type of the result of the functionCopyright © 2022 MicroStream Software. All rights reserved.