Package com.landawn.abacus.util
Class Fn
java.lang.Object
com.landawn.abacus.util.Comparators
com.landawn.abacus.util.Fn
Factory utility class for functional interfaces.
Note: Don't save and reuse any Function/Predicat/Consumer/... created by calling the methods in this class. The method should be called every time.
Note: Don't save and reuse any Function/Predicat/Consumer/... created by calling the methods in this class. The method should be called every time.
Map<String, Integer> map = N.asMap("a", 1, "b", 2, "c", 3);
// Instead of
Stream.of(map).filter(e -> e.getKey().equals("a") || e.getKey().equals("b")).toMap(e -> e.getKey(), e -> e.getValue());
// Using Fn
Stream.of(map).filter(Fn.testByKey(k -> k.equals("a") || k.equals("b"))).collect(Collectors.toMap());
- Author:
- haiyang li
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
The Class BiConsumers.static final class
The Class BiFunctions.static final class
The Class BinaryOperators.static final class
The Class BiPredicates.static final class
The Class Consumers.static final class
The Class Disposables.static final class
The Class Entries.static class
The Class Factory.static final class
Utility class forBytePredicate/Function/Consumer
.static final class
Utility class forCharPredicate/Function/Consumer
.static final class
Utility class forDoublePredicate/Function/Consumer
.static final class
Utility class forFloatPredicate/Function/Consumer
.static final class
Utility class forIntPredicate/Function/Consumer
.static final class
Utility class forLongPredicate/Function/Consumer
.static final class
Utility class for exceptionalPredicate/Function/Consumer
.static final class
Utility class forShortPredicate/Function/Consumer
.static final class
The Class Functions.static final class
The Class IntFunctions.static final class
static final class
The Class Pairs.static final class
The Class Predicates.static final class
static final class
The Class TriConsumers.static final class
The Class TriFunctions.static final class
The Class Triples.static final class
The Class TriPredicates.static final class
The Class UnaryOperators. -
Field Summary
Modifier and TypeFieldDescriptionstatic final IntFunction<LinkedHashMap<String,
Object>> static final IntFunction<Map<String,
Object>> static final ToBooleanFunction<u.OptionalBoolean>
static final ToByteFunction<u.OptionalByte>
static final ToCharFunction<u.OptionalChar>
static final ToDoubleFunction<u.OptionalDouble>
static final ToDoubleFunction<OptionalDouble>
static final ToFloatFunction<u.OptionalFloat>
static final ToIntFunction<u.OptionalInt>
static final ToIntFunction<OptionalInt>
static final ToLongFunction<u.OptionalLong>
static final ToLongFunction<OptionalLong>
static final ToShortFunction<u.OptionalShort>
static final Predicate<u.OptionalBoolean>
static final Predicate<u.OptionalByte>
static final Predicate<u.OptionalChar>
static final Predicate<u.OptionalDouble>
static final Predicate<OptionalDouble>
static final Predicate<u.OptionalFloat>
static final Predicate<u.OptionalInt>
static final Predicate<OptionalInt>
static final Predicate<u.OptionalLong>
static final Predicate<OptionalLong>
static final Predicate<u.OptionalShort>
static final Supplier<LinkedHashMap<String,
Object>> Fields inherited from class com.landawn.abacus.util.Comparators
BOOLEAN_ARRAY_COMPARATOR, BYTE_ARRAY_COMPARATOR, CHAR_ARRAY_COMPARATOR, COLLECTION_COMPARATOR, DOUBLE_ARRAY_COMPARATOR, FLOAT_ARRAY_COMPARATOR, INT_ARRAY_COMPARATOR, LONG_ARRAY_COMPARATOR, OBJECT_ARRAY_COMPARATOR, SHORT_ARRAY_COMPARATOR
-
Method Summary
Modifier and TypeMethodDescriptionacceptByKey
(Consumer<? super K> consumer) Accept by key.acceptByValue
(Consumer<? super V> consumer) Accept by value.static <T> Consumer<T>
static <T> Consumer<T>
acceptIfOrElse
(Predicate<? super T> predicate, Consumer<? super T> consumerForTrue, Consumer<? super T> consumerForFalse) acceptKeyVal
(BiConsumer<? super K, ? super V> consumer) Accept key val.static <T> Predicate<T>
static <T> Predicate<T>
static <T> Predicate<T>
and
(Collection<? extends Predicate<? super T>> c) static <T,
U> BiPredicate<T, U> and
(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second) static <T,
U> BiPredicate<T, U> and
(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second, BiPredicate<? super T, ? super U> third) static BooleanSupplier
and
(BooleanSupplier first, BooleanSupplier second) static BooleanSupplier
and
(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third) static <T> Predicate<T>
static <T> Predicate<T>
static <T,
U> BiPredicate<T, U> and
(List<? extends BiPredicate<? super T, ? super U>> c) applyByKey
(Function<? super K, R> func) Apply by key.applyByValue
(Function<? super V, R> func) Apply by value.static <A,
B, C, D, R>
Function<A,R> applyIfNotNullOrDefault
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, R> mapperD, R defaultValue) Apply if not null or default.static <A,
B, C, R> Function<A, R> applyIfNotNullOrDefault
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, R> mapperC, R defaultValue) Apply if not null or default.static <A,
B, R> Function<A, R> applyIfNotNullOrDefault
(Function<A, B> mapperA, Function<B, R> mapperB, R defaultValue) Apply if not null or default.static <A,
B, C, D, R>
Function<A,R> applyIfNotNullOrGet
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, R> mapperD, Supplier<R> supplier) Apply if not null or get.static <A,
B, C, R> Function<A, R> applyIfNotNullOrGet
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, R> mapperC, Supplier<R> supplier) Apply if not null or get.static <A,
B, R> Function<A, R> applyIfNotNullOrGet
(Function<A, B> mapperA, Function<B, R> mapperB, Supplier<R> supplier) Apply if not null or get.static <T,
R> Function<T, R> applyIfOrElseDefault
(Predicate<? super T> predicate, Function<? super T, R> func, R defaultValue) static <T,
R> Function<T, R> applyIfOrElseGet
(Predicate<? super T> predicate, Function<? super T, R> func, Supplier<? extends R> supplier) applyKeyVal
(BiFunction<? super K, ? super V, R> func) Apply key val.static <T extends Comparable<? super T>>
Predicate<T>between
(T minValue, T maxValue) Deprecated.static <A,
B, T> Consumer<T> c
(A a, B b, TriConsumer<A, B, T> triConsumer) static <A,
T, U> BiConsumer<T, U> c
(A a, TriConsumer<A, T, U> triConsumer) static <A,
T> Consumer<T> c
(A a, BiConsumer<A, T> biConsumer) static <T,
U> BiConsumer<T, U> c
(BiConsumer<T, U> biConsumer) static <R> Callable<R>
static <T> Consumer<T>
static <A,
B, C> TriConsumer<A, B, C> c
(TriConsumer<A, B, C> triConsumer) static <A,
B, C> TriFunction<A, B, C, Void> c2f
(TriConsumer<? super A, ? super B, ? super C> action) static <A,
B, C, R> TriFunction<A, B, C, R> c2f
(TriConsumer<? super A, ? super B, ? super C> action, R valueToReturn) static <T,
U> BiFunction<T, U, Void> c2f
(BiConsumer<? super T, ? super U> action) static <T,
U, R> BiFunction<T, U, R> c2f
(BiConsumer<? super T, ? super U> action, R valueToReturn) static <T,
R> Function<T, R> static <R> Runnable
static <T,
U> Function<T, U> cc
(A a, B b, Throwables.TriConsumer<A, B, T, E> triConsumer) cc
(A a, Throwables.BiConsumer<A, T, E> biConsumer) static <A,
T, U, E extends Exception>
BiConsumer<T,U> cc
(A a, Throwables.TriConsumer<A, T, U, E> triConsumer) static <T,
U, E extends Exception>
BiConsumer<T,U> cc
(Throwables.BiConsumer<T, U, E> biConsumer) cc
(Throwables.Callable<R, E> callable) cc
(Throwables.Consumer<T, E> consumer) static <A,
B, C, E extends Exception>
TriConsumer<A,B, C> cc
(Throwables.TriConsumer<A, B, C, E> triConsumer) static <T extends AutoCloseable>
Consumer<T>close()
static Runnable
close
(AutoCloseable closeable) static Runnable
closeAll
(AutoCloseable... a) static Runnable
closeAll
(Collection<? extends AutoCloseable> c) static Runnable
closeAllQuietly
(AutoCloseable... a) Close all quietly.static Runnable
closeAllQuietly
(Collection<? extends AutoCloseable> c) Close all quietly.static <T extends AutoCloseable>
Consumer<T>static Runnable
closeQuietly
(AutoCloseable closeable) static <T extends Comparable<? super T>>
BiFunction<T,T, Integer> compare()
static <T> BiFunction<T,
T, Integer> compare
(Comparator<? super T> cmp) static <T extends Comparable<? super T>>
Function<T,Integer> compareTo
(T target) compareTo
(T target, Comparator<? super T> cmp) Creates the number.static <T> Consumer<T>
static Runnable
static <K,
V> BiFunction<K, V, Map.Entry<K, V>> entry()
Deprecated.replaced byFn#entryByKeyMapper(Function)
entry
(K key) Deprecated.replaced byFn#entryWithKey(Object)
entryByKeyMapper
(Function<? super V, K> keyMapper) entryByValueMapper
(Function<? super K, V> valueMapper) entryWithKey
(K key) entryWithValue
(V value) static <T> Predicate<T>
static <T> Predicate<T>
static <T,
U> BiPredicate<T, U> equal()
static <T> Predicate<T>
static <A,
B, T, R> Function<T, R> f
(A a, B b, TriFunction<A, B, T, R> triFunction) static <A,
T, U, R> BiFunction<T, U, R> f
(A a, TriFunction<A, T, U, R> triFunction) static <A,
T, R> Function<T, R> f
(A a, BiFunction<A, T, R> biFunction) static <T,
U, R> BiFunction<T, U, R> f
(BiFunction<T, U, R> biFunction) static <T,
R> Function<T, R> static <A,
B, C, R> TriFunction<A, B, C, R> f
(TriFunction<A, B, C, R> triFunction) static <A,
B, C> TriConsumer<A, B, C> f2c
(TriFunction<? super A, ? super B, ? super C, ?> func) static <T,
U> BiConsumer<T, U> f2c
(BiFunction<? super T, ? super U, ?> func) static <T> Consumer<T>
Returns aConsumer
which calls the specifiedfunc
.ff
(A a, B b, Throwables.TriFunction<A, B, T, R, E> triFunction) ff
(A a, Throwables.BiFunction<A, T, R, E> biFunction) static <A,
T, U, R, E extends Exception>
BiFunction<T,U, R> ff
(A a, Throwables.TriFunction<A, T, U, R, E> triFunction) static <T,
U, R, E extends Exception>
BiFunction<T,U, R> ff
(Throwables.BiFunction<T, U, R, E> biFunction) static <T,
U, R, E extends Exception>
BiFunction<T,U, R> ff
(Throwables.BiFunction<T, U, R, E> biFunction, R defaultOnError) ff
(Throwables.Function<T, R, E> function) ff
(Throwables.Function<T, R, E> function, R defaultOnError) static <A,
B, C, R, E extends Exception>
TriFunction<A,B, C, R> ff
(Throwables.TriFunction<A, B, C, R, E> triFunction) static <A,
B, C, R, E extends Exception>
TriFunction<A,B, C, R> ff
(Throwables.TriFunction<A, B, C, R, E> triFunction, R defaultOnError) static <T,
U> BiPredicate<T, U> filterThenLimit
(BiPredicate<T, U> predicate, int limit) Returns a statefulPredicate
.static <T> Predicate<T>
filterThenLimit
(Predicate<T> predicate, int limit) Returns a statefulPredicate
.static <K,
V> Function<? super Map<K, ? extends Collection<? extends V>>, List<Map<K, V>>> {a=[1, 2, 3], b=[4, 5, 6], c=[7, 8]} -> [{a=1, b=4, c=7}, {a=2, b=5, c=8}, {a=3, b=6}]static <T,
U> BiConsumer<T, U> from
(BiConsumer<T, U> consumer) static <T,
U, R> BiFunction<T, U, R> from
(BiFunction<T, U, R> function) static <T> BinaryOperator<T>
from
(BinaryOperator<T> op) static <T,
U> BiPredicate<T, U> from
(BiPredicate<T, U> predicate) static <T> Consumer<T>
static <T,
R> Function<T, R> static <T> IntFunction<T>
from
(IntFunction<T> func) static <T> Predicate<T>
static <T> Supplier<T>
static <T> UnaryOperator<T>
from
(UnaryOperator<T> op) futureGetOrDefaultOnError
(T defaultValue) static <T extends Comparable<? super T>>
Predicate<T>geAndLe
(T minValue, T maxValue) Checks if the value/element:minValue <= e <= maxValue
.static <T extends Comparable<? super T>>
Predicate<T>geAndLt
(T minValue, T maxValue) Checks if the value/element:minValue <= e < maxValue
.static <T> T
static <T> Function<u.Optional<? extends T>,
T> static <T extends Comparable<? super T>>
BiPredicate<T,T> static <T extends Comparable<? super T>>
Predicate<T>greaterEqual
(T target) static <T extends Comparable<? super T>>
BiPredicate<T,T> static <T extends Comparable<? super T>>
Predicate<T>greaterThan
(T target) static <T extends Comparable<? super T>>
Predicate<T>gtAndLe
(T minValue, T maxValue) Checks if the value/element:minValue < e <= maxValue
.static <T extends Comparable<? super T>>
Predicate<T>gtAndLt
(T minValue, T maxValue) Checks if the value/element:minValue < e < maxValue
.static <T> Function<T,
T> identity()
static <T> BinaryOperator<T>
static <T> Predicate<T>
in
(Collection<?> c) indexed()
Returns a statefulPredicate
.static <T> Predicate<T>
indexed
(IndexedPredicate<T> predicate) Returns a statefulPredicate
.static <T> Predicate<T>
instanceOf
(Class<?> clazz) inverse()
Checks if is directory.isFile()
Checks if is file.static <T> Predicate<T>
isNull()
Checks if is null.static <T> Predicate<T>
Checks if is null.static <T extends CharSequence>
Predicate<T>Checks if is null or empty.static <T> Predicate<T>
isNullOrEmpty
(Function<T, ? extends CharSequence> valueExtractor) static <T> Predicate<T[]>
static <T extends Collection>
Predicate<T>static <T extends CharSequence>
Predicate<T>Checks if is null or empty or blank.static <T> Predicate<T>
isNullOrEmptyOrBlank
(Function<T, ? extends CharSequence> valueExtractor) static <T> Predicate<u.Optional<? extends T>>
static <R> Callable<R>
static Runnable
static Runnable
key()
kkv()
left()
len()
static <T extends CharSequence>
Function<T,Integer> length()
static <T extends Comparable<? super T>>
BiPredicate<T,T> static <T extends Comparable<? super T>>
Predicate<T>lessEqual
(T target) static <T extends Comparable<? super T>>
BiPredicate<T,T> lessThan()
static <T extends Comparable<? super T>>
Predicate<T>lessThan
(T target) static <T,
U> BiPredicate<T, U> limitThenFilter
(int limit, BiPredicate<T, U> predicate) Returns a statefulPredicate
.static <T> Predicate<T>
limitThenFilter
(int limit, Predicate<T> predicate) Returns a statefulPredicate
.static Predicate<CharSequence>
static <T extends Comparable<? super T>>
BinaryOperator<T>max()
static <T> BinaryOperator<T>
max
(Comparator<? super T> comparator) static <T> BinaryOperator<T>
maxBy
(Function<? super T, ? extends Comparable> keyMapper) static <K extends Comparable<? super K>,
V>
BinaryOperator<Map.Entry<K,V>> maxByKey()
static <K,
V extends Comparable<? super V>>
BinaryOperator<Map.Entry<K,V>> static <T,
R> Function<T, R> static <T> Supplier<T>
Returns aSupplier
which returns a single instance created by calling the specifiedsupplier.get()
.static <T extends Comparable<? super T>>
BinaryOperator<T>min()
static <T> BinaryOperator<T>
min
(Comparator<? super T> comparator) static <T> BinaryOperator<T>
minBy
(Function<? super T, ? extends Comparable> keyMapper) static <K extends Comparable<? super K>,
V>
BinaryOperator<Map.Entry<K,V>> minByKey()
static <K,
V extends Comparable<? super V>>
BinaryOperator<Map.Entry<K,V>> static <A,
B, C> TriPredicate<A, B, C> not
(TriPredicate<A, B, C> triPredicate) static <T,
U> BiPredicate<T, U> not
(BiPredicate<T, U> biPredicate) static <T> Predicate<T>
notContains
(String str) notEndsWith
(String suffix) Not ends with.static <T,
U> BiPredicate<T, U> notEqual()
static <T> Predicate<T>
static <T> Predicate<T>
notIn
(Collection<?> c) static <T> Predicate<T>
notNull()
static <T> Predicate<T>
Not nullstatic <T extends CharSequence>
Predicate<T>Not null or empty.static <T> Predicate<T>
notNullOrEmpty
(Function<T, ? extends CharSequence> valueExtractor) static <T> Predicate<T[]>
static <T extends Collection>
Predicate<T>static <T extends CharSequence>
Predicate<T>Not null or empty or blank.static <T> Predicate<T>
notNullOrEmptyOrBlank
(Function<T, ? extends CharSequence> valueExtractor) notStartsWith
(String prefix) Not starts with.Deprecated.replaced bynullToEmptyList
Deprecated.replaced bynullToEmptyMap
Deprecated.replaced bynullToEmptySet
static <T extends Number>
ToDoubleFunction<T>Num to double.static <T extends Number>
ToIntFunction<T>numToInt()
Num to int.static <T extends Number>
ToLongFunction<T>Num to long.static <T> Predicate<T>
or
(Collection<? extends Predicate<? super T>> c) static <T,
U> BiPredicate<T, U> or
(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second) static <T,
U> BiPredicate<T, U> or
(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second, BiPredicate<? super T, ? super U> third) static BooleanSupplier
or
(BooleanSupplier first, BooleanSupplier second) static BooleanSupplier
or
(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third) static <T> Predicate<T>
static <T> Predicate<T>
static <T,
U> BiPredicate<T, U> or
(List<? extends BiPredicate<? super T, ? super U>> c) static <A,
B, T> Predicate<T> p
(A a, B b, TriPredicate<A, B, T> triPredicate) static <A,
T, U> BiPredicate<T, U> p
(A a, TriPredicate<A, T, U> triPredicate) static <A,
T> Predicate<T> p
(A a, BiPredicate<A, T> biPredicate) static <T,
U> BiPredicate<T, U> p
(BiPredicate<T, U> biPredicate) static <T> Predicate<T>
static <A,
B, C> TriPredicate<A, B, C> p
(TriPredicate<A, B, C> triPredicate) static <L,
R> BiFunction<L, R, Pair<L, R>> pair()
Parses the byte.Parses the double.Parses the float.parseInt()
Parses the int.Parses the long.Parses the short.pp
(A a, B b, Throwables.TriPredicate<A, B, T, E> triPredicate) pp
(A a, Throwables.BiPredicate<A, T, E> biPredicate) static <A,
T, U, E extends Exception>
BiPredicate<T,U> pp
(A a, Throwables.TriPredicate<A, T, U, E> triPredicate) static <T,
U, E extends Exception>
BiPredicate<T,U> pp
(Throwables.BiPredicate<T, U, E> biPredicate) pp
(Throwables.Predicate<T, E> predicate) static <A,
B, C, E extends Exception>
TriPredicate<A,B, C> pp
(Throwables.TriPredicate<A, B, C, E> triPredicate) static <T> Consumer<T>
println()
static <T,
U> BiConsumer<T, U> static Runnable
static <R> Callable<R>
static <T> Consumer<T>
rateLimiter
(double permitsPerSecond) Returns a statefulConsumer
.static <T> Consumer<T>
rateLimiter
(RateLimiter rateLimiter) Returns a statefulConsumer
.static <T> BinaryOperator<T>
static <T,
C extends Collection<T>>
IntFunction<? extends C>reuse
(IntFunction<? extends C> supplier) Deprecated.static <T,
C extends Collection<T>>
Supplier<? extends C>Deprecated.right()
rr
(Throwables.Runnable<E> runnbale) static <A,
T> Consumer<T> sc
(Object mutex, A a, BiConsumer<A, T> biConsumer) SynchronizedConsumer
.static <T,
U> BiConsumer<T, U> sc
(Object mutex, BiConsumer<T, U> biConsumer) SynchronizedBiConsumer
.static <T> Consumer<T>
SynchronizedConsumer
.static <T> BinaryOperator<T>
static <T> BinaryOperator<T>
static <A,
T, R> Function<T, R> sf
(Object mutex, A a, BiFunction<A, T, R> biFunction) SynchronizedFunction
.static <T,
U, R> BiFunction<T, U, R> sf
(Object mutex, BiFunction<T, U, R> biFunction) SynchronizedBiFunction
.static <T,
R> Function<T, R> SynchronizedFunction
.static Runnable
shutDown
(ExecutorService service) static Runnable
shutDown
(ExecutorService service, long terminationTimeout, TimeUnit timeUnit) static <T extends Collection>
Function<T,Integer> size()
sizeM()
static <T> Consumer<T>
sleep
(long millis) static <T> Consumer<T>
sleepUninterruptibly
(long millis) static <A,
B, T> Predicate<T> sp
(Object mutex, A a, B b, TriPredicate<A, B, T> triPredicate) SynchronizedPredicate
.static <A,
T> Predicate<T> sp
(Object mutex, A a, BiPredicate<A, T> biPredicate) SynchronizedPredicate
.static <T,
U> BiPredicate<T, U> sp
(Object mutex, BiPredicate<T, U> biPredicate) SynchronizedBiPredicate
.static <T> Predicate<T>
SynchronizedPredicate
.startsWith
(String prefix) strip()
static <T> BiFunction<T,
T, MergeResult> Returns a statefulBiFunction
.Test by key.testByValue
(Predicate<? super V> predicate) Test by value.testKeyVal
(BiPredicate<? super K, ? super V> predicate) Test key val.static <T> Consumer<T>
throwException
(Supplier<? extends RuntimeException> excpetionSupplier) static <T> BinaryOperator<T>
static <T> Consumer<T>
throwRuntimeException
(String errorMessage) static <T> Predicate<T>
timeLimit
(long timeInMillis) Returns a statefulPredicate
.static <T> Predicate<T>
Returns a statefulPredicate
.To camel case.To lower case.To lower case with underscore.static Function<Throwable,
RuntimeException> toStr()
To upper case.To upper case with underscore.trim()
static <L,
M, R> TriFunction<L, M, R, Triple<L, M, R>> triple()
static <T> Function<T,
Tuple.Tuple1<T>> tuple1()
static <T,
U> BiFunction<T, U, Tuple.Tuple2<T, U>> tuple2()
static <A,
B, C> TriFunction<A, B, C, Tuple.Tuple3<A, B, C>> tuple3()
static <A,
B, C, D> QuadFunction<A, B, C, D, Tuple.Tuple4<A, B, C, D>> tuple4()
unwrap()
val()
value()
wrap()
wrap
(ToIntFunction<? super T> hashFunction, BiPredicate<? super T, ? super T> equalsFunction) Methods inherited from class com.landawn.abacus.util.Comparators
comparingArray, comparingBoolean, comparingBy, comparingBy, comparingByIfNotNullOrElseNullsFirst, comparingByIfNotNullOrElseNullsLast, comparingByKey, comparingByKey, comparingByLength, comparingByMapSize, comparingBySize, comparingByte, comparingByValue, comparingByValue, comparingChar, comparingCollection, comparingDouble, comparingFloat, comparingIgnoreCase, comparingIgnoreCase, comparingInt, comparingLong, comparingShort, naturalOrder, nullsFirst, nullsFirst, nullsFirstOrElseEqual, nullsLast, nullsLast, nullsLastOrElseEqual, reversedComparingBy, reversedComparingByIfNotNullOrElseNullsFirst, reversedComparingByIfNotNullOrElseNullsLast, reversedComparingByKey, reversedComparingByKey, reversedComparingByValue, reversedComparingByValue, reversedOrder, reversedOrder
-
Field Details
-
FACTORY_OF_MAP
-
FACTORY_OF_LINKED_HASH_MAP
-
SUPPLIER_OF_MAP
-
SUPPLIER_OF_LINKED_HASH_MAP
-
GET_AS_BOOLEAN
-
GET_AS_CHAR
-
GET_AS_BYTE
-
GET_AS_SHORT
-
GET_AS_INT
-
GET_AS_LONG
-
GET_AS_FLOAT
-
GET_AS_DOUBLE
-
GET_AS_INT_JDK
-
GET_AS_LONG_JDK
-
GET_AS_DOUBLE_JDK
-
IS_PRESENT_BOOLEAN
-
IS_PRESENT_CHAR
-
IS_PRESENT_BYTE
-
IS_PRESENT_SHORT
-
IS_PRESENT_INT
-
IS_PRESENT_LONG
-
IS_PRESENT_FLOAT
-
IS_PRESENT_DOUBLE
-
IS_PRESENT_INT_JDK
-
IS_PRESENT_LONG_JDK
-
IS_PRESENT_DOUBLE_JDK
-
-
Method Details
-
get
- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
memoize
Returns aSupplier
which returns a single instance created by calling the specifiedsupplier.get()
.- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
memoize
@Beta @SequentialOnly @Stateful public static <T,R> Function<T,R> memoize(Function<? super T, ? extends R> func) - Type Parameters:
T
-R
-- Parameters:
func
-- Returns:
-
reuse
@Deprecated @Beta @SequentialOnly @Stateful public static <T,C extends Collection<T>> Supplier<? extends C> reuse(Supplier<? extends C> supplier) Deprecated.Only for temporary use in sequential stream/single thread, not for parallel stream/multiple threads. The returned Collection will clean up before it's returned every time whenget
is called. Don't save the returned Collection object or use it to save objects.- Type Parameters:
T
-C
-- Parameters:
supplier
-- Returns:
-
reuse
@Deprecated @Beta @SequentialOnly @Stateful public static <T,C extends Collection<T>> IntFunction<? extends C> reuse(IntFunction<? extends C> supplier) Deprecated.Only for temporary use in sequential stream/single thread, not for parallel stream/multiple threads. The returned Collection will clean up before it's returned every time whenget
is called. Don't save the returned Collection object or use it to save objects.- Type Parameters:
T
-C
-- Parameters:
supplier
-- Returns:
-
close
- Parameters:
closeable
-- Returns:
-
closeAll
- Parameters:
a
-- Returns:
-
closeAll
- Parameters:
c
-- Returns:
-
closeQuietly
- Parameters:
closeable
-- Returns:
-
closeAllQuietly
Close all quietly.- Parameters:
a
-- Returns:
-
closeAllQuietly
Close all quietly.- Parameters:
c
-- Returns:
-
emptyAction
-
shutDown
-
shutDown
public static Runnable shutDown(ExecutorService service, long terminationTimeout, TimeUnit timeUnit) -
doNothing
- Type Parameters:
T
-- Returns:
-
throwRuntimeException
- Type Parameters:
T
-- Parameters:
errorMessage
-- Returns:
-
throwException
public static <T> Consumer<T> throwException(Supplier<? extends RuntimeException> excpetionSupplier) - Type Parameters:
T
-- Parameters:
excpetionSupplier
-- Returns:
-
toRuntimeException
-
close
- Type Parameters:
T
-- Returns:
-
closeQuietly
- Type Parameters:
T
-- Returns:
-
sleep
- Type Parameters:
T
-- Parameters:
millis
-- Returns:
-
sleepUninterruptibly
- Type Parameters:
T
-- Parameters:
millis
-- Returns:
-
rateLimiter
Returns a statefulConsumer
. Don't save or cache for reuse- Type Parameters:
T
-- Parameters:
rateLimiter
-- Returns:
- See Also:
-
rateLimiter
Returns a statefulConsumer
. Don't save or cache for reuse- Type Parameters:
T
-- Parameters:
rateLimiter
-- Returns:
- See Also:
-
println
- Type Parameters:
T
-- Returns:
-
println
- Type Parameters:
T
-U
-- Parameters:
separator
-- Returns:
-
toStr
- Type Parameters:
T
-- Returns:
-
toCamelCase
To camel case.- Returns:
-
toLowerCase
To lower case.- Returns:
-
toLowerCaseWithUnderscore
To lower case with underscore.- Returns:
-
toUpperCase
To upper case.- Returns:
-
toUpperCaseWithUnderscore
To upper case with underscore.- Returns:
-
identity
- Type Parameters:
T
-- Returns:
-
keyed
- Type Parameters:
K
- the key typeT
-- Parameters:
keyMapper
-- Returns:
-
val
- Type Parameters:
K
- the key typeT
-- Returns:
-
kkv
- Type Parameters:
T
-K
- the key typeV
- the value type- Returns:
-
wrap
- Type Parameters:
T
-- Returns:
-
wrap
public static <T> Function<T,Wrapper<T>> wrap(ToIntFunction<? super T> hashFunction, BiPredicate<? super T, ? super T> equalsFunction) - Type Parameters:
T
-- Parameters:
hashFunction
-equalsFunction
-- Returns:
-
unwrap
- Type Parameters:
K
- the key typeT
-- Returns:
-
key
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
value
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
left
-
right
-
inverse
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
entry
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
entry
Deprecated.replaced byFn#entryWithKey(Object)
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
-- Returns:
-
entry
Deprecated.replaced byFn#entryByKeyMapper(Function)
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyMapper
-- Returns:
-
entryWithKey
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
-- Returns:
-
entryByKeyMapper
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
keyMapper
-- Returns:
-
entryWithValue
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
value
-- Returns:
-
entryByValueMapper
public static <K,V> Function<K,Map.Entry<K, entryByValueMapperV>> (Function<? super K, V> valueMapper) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
valueMapper
-- Returns:
-
pair
- Type Parameters:
L
-R
-- Returns:
-
triple
- Type Parameters:
L
-M
-R
-- Returns:
-
tuple1
- Type Parameters:
T
-- Returns:
-
tuple2
- Type Parameters:
T
-U
-- Returns:
-
tuple3
- Type Parameters:
A
-B
-C
-- Returns:
-
tuple4
- Type Parameters:
A
-B
-C
-D
-- Returns:
-
trim
-
trimToEmpty
-
trimToNull
-
strip
-
stripToEmpty
-
stripToNull
-
nullToEmpty
-
nullToEmptyL
Deprecated.replaced bynullToEmptyList
- Type Parameters:
T
-- Returns:
-
nullToEmptyList
- Type Parameters:
T
-- Returns:
-
nullToEmptyS
Deprecated.replaced bynullToEmptySet
- Type Parameters:
T
-- Returns:
-
nullToEmptySet
- Type Parameters:
T
-- Returns:
-
nullToEmptyM
Deprecated.replaced bynullToEmptyMap
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
nullToEmptyMap
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
length
- Type Parameters:
T
-- Returns:
-
len
- Type Parameters:
T
-- Returns:
-
size
- Type Parameters:
T
-- Returns:
-
sizeM
- Type Parameters:
T
-- Returns:
-
cast
- Type Parameters:
T
-U
-- Parameters:
clazz
-- Returns:
-
alwaysTrue
- Type Parameters:
T
-- Returns:
-
alwaysFalse
- Type Parameters:
T
-- Returns:
-
isNull
Checks if is null.- Type Parameters:
T
-- Returns:
-
isNull
Checks if is null.- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
isNullOrEmpty
Checks if is null or empty.- Type Parameters:
T
-- Returns:
-
isNullOrEmpty
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
isNullOrEmptyOrBlank
Checks if is null or empty or blank.- Type Parameters:
T
-- Returns:
-
isNullOrEmptyOrBlank
public static <T> Predicate<T> isNullOrEmptyOrBlank(Function<T, ? extends CharSequence> valueExtractor) - Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
isNullOrEmptyA
-
isNullOrEmptyC
-
isNullOrEmptyM
-
notNull
- Type Parameters:
T
-- Returns:
-
notNull
Not null- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notNullOrEmpty
Not null or empty.- Type Parameters:
T
-- Returns:
-
notNullOrEmpty
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notNullOrEmptyOrBlank
Not null or empty or blank.- Type Parameters:
T
-- Returns:
-
notNullOrEmptyOrBlank
public static <T> Predicate<T> notNullOrEmptyOrBlank(Function<T, ? extends CharSequence> valueExtractor) - Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notNullOrEmptyA
-
notNullOrEmptyC
-
notNullOrEmptyM
-
isFile
Checks if is file.- Returns:
-
isDirectory
Checks if is directory.- Returns:
-
equal
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
eqOr
- Type Parameters:
T
-- Parameters:
targetValue1
-targetValue2
-- Returns:
-
eqOr
- Type Parameters:
T
-- Parameters:
targetValue1
-targetValue2
-targetValue3
-- Returns:
-
notEqual
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
greaterThan
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
greaterEqual
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
lessThan
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
lessEqual
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
gtAndLt
Checks if the value/element:minValue < e < maxValue
.- Type Parameters:
T
-- Parameters:
minValue
-maxValue
-- Returns:
-
geAndLt
Checks if the value/element:minValue <= e < maxValue
.- Type Parameters:
T
-- Parameters:
minValue
-maxValue
-- Returns:
-
geAndLe
Checks if the value/element:minValue <= e <= maxValue
.- Type Parameters:
T
-- Parameters:
minValue
-maxValue
-- Returns:
-
gtAndLe
Checks if the value/element:minValue < e <= maxValue
.- Type Parameters:
T
-- Parameters:
minValue
-maxValue
-- Returns:
-
between
@Deprecated public static <T extends Comparable<? super T>> Predicate<T> between(T minValue, T maxValue) Deprecated.replaced bygtAndLt
.Checks if the value/element:minValue < e < maxValue
.- Type Parameters:
T
-- Parameters:
minValue
-maxValue
-- Returns:
-
in
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
notIn
- Type Parameters:
T
-- Parameters:
c
-- Returns:
-
instanceOf
- Type Parameters:
T
-- Parameters:
clazz
-- Returns:
-
subtypeOf
- Parameters:
clazz
-- Returns:
-
startsWith
- Parameters:
prefix
-- Returns:
-
endsWith
- Parameters:
suffix
-- Returns:
-
contains
- Parameters:
str
-- Returns:
-
notStartsWith
Not starts with.- Parameters:
prefix
-- Returns:
-
notEndsWith
Not ends with.- Parameters:
suffix
-- Returns:
-
notContains
- Parameters:
str
-- Returns:
-
matches
- Parameters:
pattern
-- Returns:
-
equal
- Type Parameters:
T
-U
-- Returns:
-
notEqual
- Type Parameters:
T
-U
-- Returns:
-
greaterThan
- Type Parameters:
T
-- Returns:
-
greaterEqual
- Type Parameters:
T
-- Returns:
-
lessThan
- Type Parameters:
T
-- Returns:
-
lessEqual
- Type Parameters:
T
-- Returns:
-
not
- Type Parameters:
T
-- Parameters:
predicate
-- Returns:
-
not
- Type Parameters:
T
-U
-- Parameters:
biPredicate
-- Returns:
-
not
- Type Parameters:
A
-B
-C
-- Parameters:
triPredicate
-- Returns:
-
and
- Parameters:
first
-second
-- Returns:
-
and
public static BooleanSupplier and(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third) - Parameters:
first
-second
-third
-- Returns:
-
and
- Type Parameters:
T
-- Parameters:
first
-second
-- Returns:
-
and
public static <T> Predicate<T> and(Predicate<? super T> first, Predicate<? super T> second, Predicate<? super T> third) - Type Parameters:
T
-- Parameters:
first
-second
-third
-- Returns:
-
and
public static <T> Predicate<T> and(Collection<? extends Predicate<? super T>> c) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
c
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedc
is null or empty.
-
and
public static <T,U> BiPredicate<T,U> and(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second) - Type Parameters:
T
-U
-- Parameters:
first
-second
-- Returns:
-
and
public static <T,U> BiPredicate<T,U> and(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second, BiPredicate<? super T, ? super U> third) - Type Parameters:
T
-U
-- Parameters:
first
-second
-third
-- Returns:
-
and
public static <T,U> BiPredicate<T,U> and(List<? extends BiPredicate<? super T, ? super U>> c) throws IllegalArgumentException- Type Parameters:
T
-U
-- Parameters:
c
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedc
is null or empty.
-
or
- Parameters:
first
-second
-- Returns:
-
or
public static BooleanSupplier or(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third) - Parameters:
first
-second
-third
-- Returns:
-
or
- Type Parameters:
T
-- Parameters:
first
-second
-- Returns:
-
or
public static <T> Predicate<T> or(Predicate<? super T> first, Predicate<? super T> second, Predicate<? super T> third) - Type Parameters:
T
-- Parameters:
first
-second
-third
-- Returns:
-
or
public static <T> Predicate<T> or(Collection<? extends Predicate<? super T>> c) throws IllegalArgumentException - Type Parameters:
T
-- Parameters:
c
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedc
is null or empty.
-
or
public static <T,U> BiPredicate<T,U> or(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second) - Type Parameters:
T
-U
-- Parameters:
first
-second
-- Returns:
-
or
public static <T,U> BiPredicate<T,U> or(BiPredicate<? super T, ? super U> first, BiPredicate<? super T, ? super U> second, BiPredicate<? super T, ? super U> third) - Type Parameters:
T
-U
-- Parameters:
first
-second
-third
-- Returns:
-
or
public static <T,U> BiPredicate<T,U> or(List<? extends BiPredicate<? super T, ? super U>> c) throws IllegalArgumentException- Type Parameters:
T
-U
-- Parameters:
c
-- Returns:
- Throws:
IllegalArgumentException
- if the specifiedc
is null or empty.
-
testByKey
Test by key.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
predicate
-- Returns:
-
testByValue
Test by value.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
predicate
-- Returns:
-
acceptByKey
Accept by key.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
consumer
-- Returns:
-
acceptByValue
Accept by value.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
consumer
-- Returns:
-
acceptIf
-
acceptIfOrElse
-
applyByKey
Apply by key.- Type Parameters:
K
- the key typeV
- the value typeR
-- Parameters:
func
-- Returns:
-
applyByValue
Apply by value.- Type Parameters:
K
- the key typeV
- the value typeR
-- Parameters:
func
-- Returns:
-
applyIfOrElseDefault
-
applyIfOrElseGet
-
applyIfNotNullOrDefault
public static <A,B, Function<A,R> R> applyIfNotNullOrDefault(Function<A, B> mapperA, Function<B, R> mapperB, R defaultValue) Apply if not null or default.- Type Parameters:
A
-B
-R
-- Parameters:
mapperA
-mapperB
-defaultValue
-- Returns:
-
applyIfNotNullOrDefault
public static <A,B, Function<A,C, R> R> applyIfNotNullOrDefault(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, R> mapperC, R defaultValue) Apply if not null or default.- Type Parameters:
A
-B
-C
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-defaultValue
-- Returns:
-
applyIfNotNullOrDefault
public static <A,B, Function<A,C, D, R> R> applyIfNotNullOrDefault(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, R> mapperD, R defaultValue) Apply if not null or default.- Type Parameters:
A
-B
-C
-D
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-mapperD
-defaultValue
-- Returns:
-
applyIfNotNullOrGet
public static <A,B, Function<A,R> R> applyIfNotNullOrGet(Function<A, B> mapperA, Function<B, R> mapperB, Supplier<R> supplier) Apply if not null or get.- Type Parameters:
A
-B
-R
-- Parameters:
mapperA
-mapperB
-supplier
-- Returns:
-
applyIfNotNullOrGet
public static <A,B, Function<A,C, R> R> applyIfNotNullOrGet(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, R> mapperC, Supplier<R> supplier) Apply if not null or get.- Type Parameters:
A
-B
-C
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-supplier
-- Returns:
-
applyIfNotNullOrGet
public static <A,B, Function<A,C, D, R> R> applyIfNotNullOrGet(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, R> mapperD, Supplier<R> supplier) Apply if not null or get.- Type Parameters:
A
-B
-C
-D
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-mapperD
-supplier
-- Returns:
-
mapKey
public static <K,V, Function<Map.Entry<K,KK> V>, mapKeyMap.Entry<KK, V>> (Function<? super K, ? extends KK> func) - Type Parameters:
K
- the key typeV
- the value typeKK
-- Parameters:
func
-- Returns:
-
mapValue
public static <K,V, Function<Map.Entry<K,VV> V>, mapValueMap.Entry<K, VV>> (Function<? super V, ? extends VV> func) - Type Parameters:
K
- the key typeV
- the value typeVV
-- Parameters:
func
-- Returns:
-
testKeyVal
public static <K,V> Predicate<Map.Entry<K,V>> testKeyVal(BiPredicate<? super K, ? super V> predicate) Test key val.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
predicate
-- Returns:
-
acceptKeyVal
public static <K,V> Consumer<Map.Entry<K,V>> acceptKeyVal(BiConsumer<? super K, ? super V> consumer) Accept key val.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
consumer
-- Returns:
-
applyKeyVal
public static <K,V, Function<Map.Entry<K,R> V>, applyKeyValR> (BiFunction<? super K, ? super V, R> func) Apply key val.- Type Parameters:
K
- the key typeV
- the value typeR
-- Parameters:
func
-- Returns:
-
flatToMap
public static <K,V> Function<? super Map<K,? extends Collection<? extends V>>, flatToMap()List<Map<K, V>>> {a=[1, 2, 3], b=[4, 5, 6], c=[7, 8]} -> [{a=1, b=4, c=7}, {a=2, b=5, c=8}, {a=3, b=6}]- Type Parameters:
K
- the key typeV
- the value type- Returns:
- See Also:
-
parseByte
Parses the byte.- Returns:
-
parseShort
Parses the short.- Returns:
-
parseInt
Parses the int.- Returns:
-
parseLong
Parses the long.- Returns:
-
parseFloat
Parses the float.- Returns:
-
parseDouble
Parses the double.- Returns:
-
createNumber
Creates the number.- Returns:
- See Also:
-
numToInt
Num to int.- Type Parameters:
T
-- Returns:
-
numToLong
Num to long.- Type Parameters:
T
-- Returns:
-
numToDouble
Num to double.- Type Parameters:
T
-- Returns:
-
limitThenFilter
@Beta @SequentialOnly @Stateful public static <T> Predicate<T> limitThenFilter(int limit, Predicate<T> predicate) Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
limit
-predicate
-- Returns:
-
limitThenFilter
@Beta @SequentialOnly @Stateful public static <T,U> BiPredicate<T,U> limitThenFilter(int limit, BiPredicate<T, U> predicate) Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-U
-- Parameters:
limit
-predicate
-- Returns:
-
filterThenLimit
@Beta @SequentialOnly @Stateful public static <T> Predicate<T> filterThenLimit(Predicate<T> predicate, int limit) Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
predicate
-limit
-- Returns:
-
filterThenLimit
@Beta @SequentialOnly @Stateful public static <T,U> BiPredicate<T,U> filterThenLimit(BiPredicate<T, U> predicate, int limit) Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-U
-- Parameters:
predicate
-limit
-- Returns:
-
timeLimit
Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
timeInMillis
-- Returns:
-
timeLimit
Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
duration
-- Returns:
-
indexed
Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Returns:
-
indexed
@Beta @SequentialOnly @Stateful public static <T> Predicate<T> indexed(IndexedPredicate<T> predicate) Returns a statefulPredicate
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Parameters:
predicate
-- Returns:
-
selectFirst
- Type Parameters:
T
-U
-- Returns:
-
selectSecond
- Type Parameters:
T
-U
-- Returns:
-
min
- Type Parameters:
T
-- Returns:
-
min
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
minBy
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
minByKey
- Type Parameters:
T
-- Returns:
-
minByValue
- Type Parameters:
T
-- Returns:
-
max
- Type Parameters:
T
-- Returns:
-
max
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
maxBy
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
maxByKey
- Type Parameters:
T
-- Returns:
-
maxByValue
- Type Parameters:
T
-- Returns:
-
compareTo
- Type Parameters:
T
-- Parameters:
target
-- Returns:
-
compareTo
- Type Parameters:
T
-- Parameters:
target
-cmp
-- Returns:
-
compare
- Type Parameters:
T
-- Returns:
-
compare
- Type Parameters:
T
-- Parameters:
cmp
-- Returns:
-
futureGetOrDefaultOnError
- Type Parameters:
T
-- Parameters:
defaultValue
-- Returns:
-
futureGet
- Type Parameters:
T
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
func
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
predicate
-- Returns:
-
from
- Type Parameters:
T
-U
-- Parameters:
predicate
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
consumer
-- Returns:
-
from
- Type Parameters:
T
-U
-- Parameters:
consumer
-- Returns:
-
from
- Type Parameters:
T
-R
-- Parameters:
function
-- Returns:
-
from
- Type Parameters:
T
-U
-R
-- Parameters:
function
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
op
-- Returns:
-
from
- Type Parameters:
T
-- Parameters:
op
-- Returns:
-
p
- Type Parameters:
T
-- Parameters:
predicate
-- Returns:
-
p
- Type Parameters:
A
-T
-- Parameters:
a
-biPredicate
-- Returns:
-
p
- Type Parameters:
A
-B
-T
-- Parameters:
a
-b
-triPredicate
-- Returns:
-
p
- Type Parameters:
T
-U
-- Parameters:
biPredicate
-- Returns:
-
p
- Type Parameters:
A
-T
-U
-- Parameters:
a
-triPredicate
-- Returns:
-
p
- Type Parameters:
A
-B
-C
-- Parameters:
triPredicate
-- Returns:
-
c
- Type Parameters:
T
-- Parameters:
predicate
-- Returns:
-
c
- Type Parameters:
A
-T
-- Parameters:
a
-biConsumer
-- Returns:
-
c
- Type Parameters:
A
-B
-T
-- Parameters:
a
-b
-triConsumer
-- Returns:
-
c
- Type Parameters:
T
-U
-- Parameters:
biConsumer
-- Returns:
-
c
- Type Parameters:
A
-T
-U
-- Parameters:
a
-triConsumer
-- Returns:
-
c
- Type Parameters:
A
-B
-C
-- Parameters:
triConsumer
-- Returns:
-
f
- Type Parameters:
T
-R
-- Parameters:
predicate
-- Returns:
-
f
- Type Parameters:
A
-T
-R
-- Parameters:
a
-biFunction
-- Returns:
-
f
- Type Parameters:
A
-B
-T
-R
-- Parameters:
a
-b
-triFunction
-- Returns:
-
f
- Type Parameters:
T
-U
-R
-- Parameters:
biFunction
-- Returns:
-
f
- Type Parameters:
A
-T
-U
-R
-- Parameters:
a
-triFunction
-- Returns:
-
f
- Type Parameters:
A
-B
-C
-R
-- Parameters:
triFunction
-- Returns:
-
pp
- Type Parameters:
T
-E
-- Parameters:
predicate
-- Returns:
-
pp
@Beta public static <A,T, Predicate<T> ppE extends Exception> (A a, Throwables.BiPredicate<A, T, E> biPredicate) - Type Parameters:
A
-T
-E
-- Parameters:
a
-biPredicate
-- Returns:
-
pp
@Beta public static <A,B, Predicate<T> ppT, E extends Exception> (A a, B b, Throwables.TriPredicate<A, B, T, E> triPredicate) - Type Parameters:
A
-B
-T
-E
-- Parameters:
a
-b
-triPredicate
-- Returns:
-
pp
@Beta public static <T,U, BiPredicate<T,E extends Exception> U> pp(Throwables.BiPredicate<T, U, E> biPredicate) - Type Parameters:
T
-U
-E
-- Parameters:
biPredicate
-- Returns:
-
pp
@Beta public static <A,T, BiPredicate<T,U, E extends Exception> U> pp(A a, Throwables.TriPredicate<A, T, U, E> triPredicate) - Type Parameters:
A
-T
-U
-E
-- Parameters:
a
-triPredicate
-- Returns:
-
pp
@Beta public static <A,B, TriPredicate<A,C, E extends Exception> B, ppC> (Throwables.TriPredicate<A, B, C, E> triPredicate) - Type Parameters:
A
-B
-C
-E
-- Parameters:
triPredicate
-- Returns:
-
cc
- Type Parameters:
T
-E
-- Parameters:
consumer
-- Returns:
-
cc
@Beta public static <A,T, Consumer<T> ccE extends Exception> (A a, Throwables.BiConsumer<A, T, E> biConsumer) - Type Parameters:
A
-T
-E
-- Parameters:
a
-biConsumer
-- Returns:
-
cc
@Beta public static <A,B, Consumer<T> ccT, E extends Exception> (A a, B b, Throwables.TriConsumer<A, B, T, E> triConsumer) - Type Parameters:
A
-B
-T
-E
-- Parameters:
a
-b
-triConsumer
-- Returns:
-
cc
@Beta public static <T,U, BiConsumer<T,E extends Exception> U> cc(Throwables.BiConsumer<T, U, E> biConsumer) - Type Parameters:
T
-U
-E
-- Parameters:
biConsumer
-- Returns:
-
cc
@Beta public static <A,T, BiConsumer<T,U, E extends Exception> U> cc(A a, Throwables.TriConsumer<A, T, U, E> triConsumer) - Type Parameters:
A
-T
-U
-E
-- Parameters:
a
-triConsumer
-- Returns:
-
cc
@Beta public static <A,B, TriConsumer<A,C, E extends Exception> B, ccC> (Throwables.TriConsumer<A, B, C, E> triConsumer) - Type Parameters:
A
-B
-C
-E
-- Parameters:
triConsumer
-- Returns:
-
ff
@Beta public static <T,R, Function<T,E extends Exception> R> ff(Throwables.Function<T, R, E> function) - Type Parameters:
T
-R
-E
-- Parameters:
function
-- Returns:
-
ff
@Beta public static <T,R, Function<T,E extends Exception> R> ff(Throwables.Function<T, R, E> function, R defaultOnError) - Type Parameters:
T
-R
-E
-- Parameters:
function
-defaultOnError
-- Returns:
-
ff
@Beta public static <A,T, Function<T,R, E extends Exception> R> ff(A a, Throwables.BiFunction<A, T, R, E> biFunction) - Type Parameters:
A
-T
-R
-E
-- Parameters:
a
-biFunction
-- Returns:
-
ff
@Beta public static <A,B, Function<T,T, R, E extends Exception> R> ff(A a, B b, Throwables.TriFunction<A, B, T, R, E> triFunction) - Type Parameters:
A
-B
-T
-R
-E
-- Parameters:
a
-b
-triFunction
-- Returns:
-
ff
@Beta public static <T,U, BiFunction<T,R, E extends Exception> U, ffR> (Throwables.BiFunction<T, U, R, E> biFunction) - Type Parameters:
T
-U
-R
-E
-- Parameters:
biFunction
-- Returns:
-
ff
@Beta public static <T,U, BiFunction<T,R, E extends Exception> U, ffR> (Throwables.BiFunction<T, U, R, E> biFunction, R defaultOnError) - Type Parameters:
T
-U
-R
-E
-- Parameters:
biFunction
-defaultOnError
-
-
ff
@Beta public static <A,T, BiFunction<T,U, R, E extends Exception> U, ffR> (A a, Throwables.TriFunction<A, T, U, R, E> triFunction) - Type Parameters:
A
-T
-U
-R
-E
-- Parameters:
a
-triFunction
-- Returns:
-
ff
@Beta public static <A,B, TriFunction<A,C, R, E extends Exception> B, ffC, R> (Throwables.TriFunction<A, B, C, R, E> triFunction) - Type Parameters:
A
-B
-C
-R
-E
-- Parameters:
triFunction
-- Returns:
-
ff
@Beta public static <A,B, TriFunction<A,C, R, E extends Exception> B, ffC, R> (Throwables.TriFunction<A, B, C, R, E> triFunction, R defaultOnError) - Type Parameters:
A
-B
-C
-R
-E
-- Parameters:
triFunction
-defaultOnError
-- Returns:
-
sp
SynchronizedPredicate
.- Type Parameters:
T
-- Parameters:
mutex
- to synchronized onpredicate
-- Returns:
-
sp
SynchronizedPredicate
.- Type Parameters:
A
-T
-- Parameters:
mutex
- to synchronized ona
-biPredicate
-- Returns:
-
sp
@Beta public static <A,B, Predicate<T> spT> (Object mutex, A a, B b, TriPredicate<A, B, T> triPredicate) SynchronizedPredicate
.- Type Parameters:
A
-B
-T
-- Parameters:
mutex
- to synchronized ona
-b
-triPredicate
-- Returns:
-
sp
SynchronizedBiPredicate
.- Type Parameters:
T
-U
-- Parameters:
mutex
- to synchronized onbiPredicate
-- Returns:
-
sc
SynchronizedConsumer
.- Type Parameters:
T
-- Parameters:
mutex
- to synchronized onconsumer
-- Returns:
-
sc
SynchronizedConsumer
.- Type Parameters:
A
-T
-- Parameters:
mutex
- to synchronized ona
-biConsumer
-- Returns:
-
sc
SynchronizedBiConsumer
.- Type Parameters:
T
-U
-- Parameters:
mutex
- to synchronized onbiConsumer
-- Returns:
-
sf
SynchronizedFunction
.- Type Parameters:
T
-R
-- Parameters:
mutex
- to synchronized onfunction
-- Returns:
-
sf
SynchronizedFunction
.- Type Parameters:
A
-T
-R
-- Parameters:
mutex
- to synchronized ona
-biFunction
-- Returns:
-
sf
SynchronizedBiFunction
.- Type Parameters:
T
-U
-R
-- Parameters:
mutex
- to synchronized onbiFunction
-- Returns:
-
c2f
-
c2f
-
c2f
-
c2f
public static <T,U, BiFunction<T,R> U, c2fR> (BiConsumer<? super T, ? super U> action, R valueToReturn) -
c2f
public static <A,B, TriFunction<A,C> B, c2fC, Void> (TriConsumer<? super A, ? super B, ? super C> action) -
c2f
public static <A,B, TriFunction<A,C, R> B, c2fC, R> (TriConsumer<? super A, ? super B, ? super C> action, R valueToReturn) -
f2c
Returns aConsumer
which calls the specifiedfunc
.- Type Parameters:
T
-- Parameters:
func
-- Returns:
-
f2c
-
f2c
-
rr
-
cc
-
r2c
- Parameters:
runnable
-- Returns:
-
r2c
- Parameters:
runnable
-valueToReturn
-- Returns:
-
c2r
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
r
- Parameters:
runnable
-- Returns:
-
c
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
jr2r
-
jr2c
-
jc2c
-
jc2r
-
throwingMerger
- Type Parameters:
T
-- Returns:
-
ignoringMerger
- Type Parameters:
T
-- Returns:
-
replacingMerger
- Type Parameters:
T
-- Returns:
-
getIfPresentOrElseNull
-
getIfPresentOrElseNullJdk
-
isPresent
-
isPresentJdk
-
switchOnNext
Returns a statefulBiFunction
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Returns:
-
gtAndLt
.