Package com.landawn.abacus.util
Class Fn
java.lang.Object
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
Nested ClassesModifier 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 Classstatic 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
FieldsModifier and TypeFieldDescriptionstatic 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>
-
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, ? extends R> func) Apply by key.applyByValue
(Function<? super V, ? extends R> func) Apply by value.static <A,
B, R> Function<A, R> applyIfNotNullOrDefault
(Function<A, B> mapperA, Function<B, ? extends R> mapperB, 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, ? extends R> mapperC, R defaultValue) Apply if not null or default.static <A,
B, C, D, R>
Function<A,R> applyIfNotNullOrDefault
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, ? extends R> mapperD, R defaultValue) Apply if not null or default.static <A,
B, R> Function<A, R> applyIfNotNullOrElseGet
(Function<A, B> mapperA, Function<B, ? extends R> mapperB, Supplier<R> supplier) Apply if not null or get.static <A,
B, C, R> Function<A, R> applyIfNotNullOrElseGet
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, ? extends R> mapperC, Supplier<R> supplier) Apply if not null or get.static <A,
B, C, D, R>
Function<A,R> applyIfNotNullOrElseGet
(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, ? extends R> mapperD, Supplier<R> supplier) Apply if not null or get.static <T,
R> Function<T, R> applyIfOrElseDefault
(Predicate<? super T> predicate, Function<? super T, ? extends R> func, R defaultValue) static <T,
R> Function<T, R> applyIfOrElseGet
(Predicate<? super T> predicate, Function<? super T, ? extends R> func, Supplier<? extends R> supplier) applyKeyVal
(BiFunction<? super K, ? super V, ? extends R> func) Apply key val.static <T> Predicate<T>
atMost
(int count) 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> static <A,
B, T> Consumer<T> cc
(A a, B b, Throwables.TriConsumer<A, B, T, ? extends Exception> triConsumer) static <A,
T> Consumer<T> cc
(A a, Throwables.BiConsumer<A, T, ? extends Exception> biConsumer) static <A,
T, U> BiConsumer<T, U> cc
(A a, Throwables.TriConsumer<A, T, U, ? extends Exception> triConsumer) static <T,
U> BiConsumer<T, U> cc
(Throwables.BiConsumer<T, U, ? extends Exception> biConsumer) static <R> Callable<R>
cc
(Throwables.Callable<R, ? extends Exception> callable) static <T> Consumer<T>
cc
(Throwables.Consumer<T, ? extends Exception> consumer) static <A,
B, C> TriConsumer<A, B, C> cc
(Throwables.TriConsumer<A, B, C, ? extends Exception> 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
.static <A,
B, T, R> Function<T, R> ff
(A a, B b, Throwables.TriFunction<A, B, T, R, ? extends Exception> triFunction) static <A,
T, R> Function<T, R> ff
(A a, Throwables.BiFunction<A, T, R, ? extends Exception> biFunction) static <A,
T, U, R> BiFunction<T, U, R> ff
(A a, Throwables.TriFunction<A, T, U, R, ? extends Exception> triFunction) static <T,
U, R> BiFunction<T, U, R> ff
(Throwables.BiFunction<T, U, R, ? extends Exception> biFunction) static <T,
U, R> BiFunction<T, U, R> ff
(Throwables.BiFunction<T, U, R, ? extends Exception> biFunction, R defaultOnError) static <T,
R> Function<T, R> ff
(Throwables.Function<T, ? extends R, ? extends Exception> function) static <T,
R> Function<T, R> ff
(Throwables.Function<T, ? extends R, ? extends Exception> function, R defaultOnError) static <A,
B, C, R> TriFunction<A, B, C, R> ff
(Throwables.TriFunction<A, B, C, R, ? extends Exception> triFunction) static <A,
B, C, R> TriFunction<A, B, C, R> ff
(Throwables.TriFunction<A, B, C, R, ? extends Exception> 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, ? extends 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<? extends 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> 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
(IntObjPredicate<T> predicate) Returns a statefulPredicate
.static <T> Predicate<T>
instanceOf
(Class<?> clazz) inverse()
static <T extends CharSequence>
Predicate<T>isBlank()
Checks if is null or empty or blank.static <T> Predicate<T>
isBlank
(Function<T, ? extends CharSequence> valueExtractor) Checks if is directory.static <T extends CharSequence>
Predicate<T>isEmpty()
Checks if is null or empty.static <T> Predicate<T>
isEmpty
(Function<T, ? extends CharSequence> valueExtractor) static <T> Predicate<T[]>
isEmptyA()
static <T extends Collection>
Predicate<T>isEmptyC()
isEmptyM()
isFile()
Checks if is file.static <T> Predicate<T>
isNull()
Checks if is null.static <T> Predicate<T>
Checks if is null.static <T> Predicate<u.Optional<? extends T>>
static <R> Callable<R>
static <R> Callable<R>
static Runnable
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> Supplier<T>
memoizeWithExpiration
(Supplier<T> supplier, long duration, TimeUnit unit) Copied from Google Guava under Apache License v2.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>
static <T extends CharSequence>
Predicate<T>notBlank()
Not null or empty or blank.static <T> Predicate<T>
notBlank
(Function<T, ? extends CharSequence> valueExtractor) notContains
(String str) static <T extends CharSequence>
Predicate<T>notEmpty()
Not null or empty.static <T> Predicate<T>
notEmpty
(Function<T, ? extends CharSequence> valueExtractor) static <T> Predicate<T[]>
static <T extends Collection>
Predicate<T>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 null.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.static <A,
B, T> Predicate<T> pp
(A a, B b, Throwables.TriPredicate<A, B, T, ? extends Exception> triPredicate) static <A,
T> Predicate<T> pp
(A a, Throwables.BiPredicate<A, T, ? extends Exception> biPredicate) static <A,
T, U> BiPredicate<T, U> pp
(A a, Throwables.TriPredicate<A, T, U, ? extends Exception> triPredicate) static <T,
U> BiPredicate<T, U> pp
(Throwables.BiPredicate<T, U, ? extends Exception> biPredicate) static <T> Predicate<T>
pp
(Throwables.Predicate<T, ? extends Exception> predicate) static <A,
B, C> TriPredicate<A, B, C> pp
(Throwables.TriPredicate<A, B, C, ? extends Exception> 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>
right()
static Runnable
rr
(Throwables.Runnable<? extends Exception> 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.toJson()
To lower case.To lower case with underscore.static Function<Throwable,
RuntimeException> toStr()
To upper case.To upper case with underscore.toXml()
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)
-
Field Details
-
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
-
memoize
Returns aSupplier
which returns a single instance created by calling the specifiedsupplier.get()
.- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
memoizeWithExpiration
public static <T> Supplier<T> memoizeWithExpiration(Supplier<T> supplier, long duration, TimeUnit unit) Copied from Google Guava under Apache License v2.
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed. Subsequent calls toget()
return the cached value if the expiration time has not passed. After the expiration time, a new value is retrieved, cached, and returned. See: memoizationThe returned supplier is thread-safe. The supplier's serialized form does not contain the cached value, which will be recalculated when
get()
is called on the reserialized instance. The actual memoization does not happen when the underlying delegate throws an exception.When the underlying delegate throws an exception then this memoizing supplier will keep delegating calls until it returns valid data.
- Parameters:
duration
- the length of time after a value is created that it should stop being returned by subsequentget()
callsunit
- the unit thatduration
is expressed in- Throws:
IllegalArgumentException
- ifduration
is not positive- Since:
- 2.0
-
memoize
- Type Parameters:
T
-R
-- Parameters:
func
-- 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
- Returns:
-
shutDown
- Parameters:
service
-- Returns:
-
shutDown
public static Runnable shutDown(ExecutorService service, long terminationTimeout, TimeUnit timeUnit) - Parameters:
service
-terminationTimeout
-timeUnit
-- Returns:
-
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
- Returns:
-
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:
permitsPerSecond
-- 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:
-
toJson
- Type Parameters:
T
-- Returns:
-
toXml
- Type Parameters:
T
-- 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:
T
-- Returns:
-
key
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
value
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
left
- Type Parameters:
L
-R
-- Returns:
-
right
- Type Parameters:
L
-R
-- Returns:
-
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
- Returns:
-
trimToEmpty
- Returns:
-
trimToNull
- Returns:
-
strip
- Returns:
-
stripToEmpty
- Returns:
-
stripToNull
- Returns:
-
nullToEmpty
- Returns:
-
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:
-
len
- Type Parameters:
T
-- Returns:
-
length
- 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:
-
isEmpty
Checks if is null or empty.- Type Parameters:
T
-- Returns:
-
isEmpty
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
isBlank
Checks if is null or empty or blank.- Type Parameters:
T
-- Returns:
-
isBlank
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
isEmptyA
- Type Parameters:
T
-- Returns:
-
isEmptyC
- Type Parameters:
T
-- Returns:
-
isEmptyM
- Type Parameters:
T
-- Returns:
-
notNull
- Type Parameters:
T
-- Returns:
-
notNull
Not null.- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notEmpty
Not null or empty.- Type Parameters:
T
-- Returns:
-
notEmpty
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notBlank
Not null or empty or blank.- Type Parameters:
T
-- Returns:
-
notBlank
- Type Parameters:
T
-- Parameters:
valueExtractor
-- Returns:
-
notEmptyA
- Type Parameters:
T
-- Returns:
-
notEmptyC
- Type Parameters:
T
-- Returns:
-
notEmptyM
- Type Parameters:
T
-- Returns:
-
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
@Beta public static <T> Consumer<T> acceptIf(Predicate<? super T> predicate, Consumer<? super T> consumer) - Type Parameters:
T
-- Parameters:
predicate
-consumer
-- Returns:
-
acceptIfOrElse
@Beta public static <T> Consumer<T> acceptIfOrElse(Predicate<? super T> predicate, Consumer<? super T> consumerForTrue, Consumer<? super T> consumerForFalse) - Type Parameters:
T
-- Parameters:
predicate
-consumerForTrue
-consumerForFalse
-- Returns:
-
applyByKey
Apply by key.- Type Parameters:
K
- the key typeV
- the value typeR
-- Parameters:
func
-- Returns:
-
applyByValue
public static <K,V, Function<Map.Entry<K,R> V>, applyByValueR> (Function<? super V, ? extends R> func) Apply by value.- Type Parameters:
K
- the key typeV
- the value typeR
-- Parameters:
func
-- Returns:
-
applyIfOrElseDefault
@Beta public static <T,R> Function<T,R> applyIfOrElseDefault(Predicate<? super T> predicate, Function<? super T, ? extends R> func, R defaultValue) - Type Parameters:
T
-R
-- Parameters:
predicate
-func
-defaultValue
-- Returns:
-
applyIfOrElseGet
@Beta public static <T,R> Function<T,R> applyIfOrElseGet(Predicate<? super T> predicate, Function<? super T, ? extends R> func, Supplier<? extends R> supplier) - Type Parameters:
T
-R
-- Parameters:
predicate
-func
-supplier
-- Returns:
-
applyIfNotNullOrDefault
public static <A,B, Function<A,R> R> applyIfNotNullOrDefault(Function<A, B> mapperA, Function<B, ? extends 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, ? extends 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, ? extends R> mapperD, R defaultValue) Apply if not null or default.- Type Parameters:
A
-B
-C
-D
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-mapperD
-defaultValue
-- Returns:
-
applyIfNotNullOrElseGet
public static <A,B, Function<A,R> R> applyIfNotNullOrElseGet(Function<A, B> mapperA, Function<B, ? extends R> mapperB, Supplier<R> supplier) Apply if not null or get.- Type Parameters:
A
-B
-R
-- Parameters:
mapperA
-mapperB
-supplier
-- Returns:
-
applyIfNotNullOrElseGet
public static <A,B, Function<A,C, R> R> applyIfNotNullOrElseGet(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, ? extends R> mapperC, Supplier<R> supplier) Apply if not null or get.- Type Parameters:
A
-B
-C
-R
-- Parameters:
mapperA
-mapperB
-mapperC
-supplier
-- Returns:
-
applyIfNotNullOrElseGet
public static <A,B, Function<A,C, D, R> R> applyIfNotNullOrElseGet(Function<A, B> mapperA, Function<B, C> mapperB, Function<C, D> mapperC, Function<D, ? extends 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, ? extends 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:
-
atMost
- Type Parameters:
T
-- Parameters:
count
-- 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(IntObjPredicate<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
-- Returns:
-
selectSecond
- Type Parameters:
T
-- Returns:
-
min
- Type Parameters:
T
-- Returns:
-
min
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
minBy
- Type Parameters:
T
-- Parameters:
keyMapper
-- Returns:
-
minByKey
- Type Parameters:
K
-V
-- Returns:
-
minByValue
- Type Parameters:
K
-V
-- Returns:
-
max
- Type Parameters:
T
-- Returns:
-
max
- Type Parameters:
T
-- Parameters:
comparator
-- Returns:
-
maxBy
- Type Parameters:
T
-- Parameters:
keyMapper
-- Returns:
-
maxByKey
- Type Parameters:
K
-V
-- Returns:
-
maxByValue
- Type Parameters:
K
-V
-- 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
-- Parameters:
predicate
-- Returns:
-
pp
@Beta public static <A,T> Predicate<T> pp(A a, Throwables.BiPredicate<A, T, ? extends Exception> biPredicate) - Type Parameters:
A
-T
-- Parameters:
a
-biPredicate
-- Returns:
-
pp
@Beta public static <A,B, Predicate<T> ppT> (A a, B b, Throwables.TriPredicate<A, B, T, ? extends Exception> triPredicate) - Type Parameters:
A
-B
-T
-- Parameters:
a
-b
-triPredicate
-- Returns:
-
pp
@Beta public static <T,U> BiPredicate<T,U> pp(Throwables.BiPredicate<T, U, ? extends Exception> biPredicate) - Type Parameters:
T
-U
-- Parameters:
biPredicate
-- Returns:
-
pp
@Beta public static <A,T, BiPredicate<T,U> U> pp(A a, Throwables.TriPredicate<A, T, U, ? extends Exception> triPredicate) - Type Parameters:
A
-T
-U
-- Parameters:
a
-triPredicate
-- Returns:
-
pp
@Beta public static <A,B, TriPredicate<A,C> B, ppC> (Throwables.TriPredicate<A, B, C, ? extends Exception> triPredicate) - Type Parameters:
A
-B
-C
-- Parameters:
triPredicate
-- Returns:
-
cc
- Type Parameters:
T
-- Parameters:
consumer
-- Returns:
-
cc
@Beta public static <A,T> Consumer<T> cc(A a, Throwables.BiConsumer<A, T, ? extends Exception> biConsumer) - Type Parameters:
A
-T
-- Parameters:
a
-biConsumer
-- Returns:
-
cc
@Beta public static <A,B, Consumer<T> ccT> (A a, B b, Throwables.TriConsumer<A, B, T, ? extends Exception> triConsumer) - Type Parameters:
A
-B
-T
-- Parameters:
a
-b
-triConsumer
-- Returns:
-
cc
@Beta public static <T,U> BiConsumer<T,U> cc(Throwables.BiConsumer<T, U, ? extends Exception> biConsumer) - Type Parameters:
T
-U
-- Parameters:
biConsumer
-- Returns:
-
cc
@Beta public static <A,T, BiConsumer<T,U> U> cc(A a, Throwables.TriConsumer<A, T, U, ? extends Exception> triConsumer) - Type Parameters:
A
-T
-U
-- Parameters:
a
-triConsumer
-- Returns:
-
cc
@Beta public static <A,B, TriConsumer<A,C> B, ccC> (Throwables.TriConsumer<A, B, C, ? extends Exception> triConsumer) - Type Parameters:
A
-B
-C
-- Parameters:
triConsumer
-- Returns:
-
ff
@Beta public static <T,R> Function<T,R> ff(Throwables.Function<T, ? extends R, ? extends Exception> function) - Type Parameters:
T
-R
-- Parameters:
function
-- Returns:
-
ff
@Beta public static <T,R> Function<T,R> ff(Throwables.Function<T, ? extends R, ? extends Exception> function, R defaultOnError) - Type Parameters:
T
-R
-- Parameters:
function
-defaultOnError
-- Returns:
-
ff
@Beta public static <A,T, Function<T,R> R> ff(A a, Throwables.BiFunction<A, T, R, ? extends Exception> biFunction) - Type Parameters:
A
-T
-R
-- Parameters:
a
-biFunction
-- Returns:
-
ff
@Beta public static <A,B, Function<T,T, R> R> ff(A a, B b, Throwables.TriFunction<A, B, T, R, ? extends Exception> triFunction) - Type Parameters:
A
-B
-T
-R
-- Parameters:
a
-b
-triFunction
-- Returns:
-
ff
@Beta public static <T,U, BiFunction<T,R> U, ffR> (Throwables.BiFunction<T, U, R, ? extends Exception> biFunction) - Type Parameters:
T
-U
-R
-- Parameters:
biFunction
-- Returns:
-
ff
@Beta public static <T,U, BiFunction<T,R> U, ffR> (Throwables.BiFunction<T, U, R, ? extends Exception> biFunction, R defaultOnError) - Type Parameters:
T
-U
-R
-- Parameters:
biFunction
-defaultOnError
-- Returns:
-
ff
@Beta public static <A,T, BiFunction<T,U, R> U, ffR> (A a, Throwables.TriFunction<A, T, U, R, ? extends Exception> triFunction) - Type Parameters:
A
-T
-U
-R
-- Parameters:
a
-triFunction
-- Returns:
-
ff
@Beta public static <A,B, TriFunction<A,C, R> B, ffC, R> (Throwables.TriFunction<A, B, C, R, ? extends Exception> triFunction) - Type Parameters:
A
-B
-C
-R
-- Parameters:
triFunction
-- Returns:
-
ff
@Beta public static <A,B, TriFunction<A,C, R> B, ffC, R> (Throwables.TriFunction<A, B, C, R, ? extends Exception> triFunction, R defaultOnError) - Type Parameters:
A
-B
-C
-R
-- 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
- Type Parameters:
T
-- Parameters:
action
-- Returns:
-
c2f
- Type Parameters:
T
-R
-- Parameters:
action
-valueToReturn
-- Returns:
-
c2f
- Type Parameters:
T
-U
-- Parameters:
action
-- Returns:
-
c2f
public static <T,U, BiFunction<T,R> U, c2fR> (BiConsumer<? super T, ? super U> action, R valueToReturn) - Type Parameters:
T
-U
-R
-- Parameters:
action
-valueToReturn
-- Returns:
-
c2f
public static <A,B, TriFunction<A,C> B, c2fC, Void> (TriConsumer<? super A, ? super B, ? super C> action) - Type Parameters:
A
-B
-C
-- Parameters:
action
-- Returns:
-
c2f
public static <A,B, TriFunction<A,C, R> B, c2fC, R> (TriConsumer<? super A, ? super B, ? super C> action, R valueToReturn) - Type Parameters:
A
-B
-C
-R
-- Parameters:
action
-valueToReturn
-- Returns:
-
f2c
Returns aConsumer
which calls the specifiedfunc
.- Type Parameters:
T
-- Parameters:
func
-- Returns:
-
f2c
- Type Parameters:
T
-U
-- Parameters:
func
-- Returns:
-
f2c
- Type Parameters:
A
-B
-C
-- Parameters:
func
-- Returns:
-
rr
- Parameters:
runnbale
-- Returns:
-
cc
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
r
- Parameters:
runnable
-- Returns:
-
c
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
jr
- Parameters:
runnable
-- Returns:
-
jc
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
r2c
- Parameters:
runnable
-- Returns:
-
r2c
- Type Parameters:
R
-- Parameters:
runnable
-valueToReturn
-- Returns:
-
c2r
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
jr2r
- Parameters:
runnable
-- Returns:
-
jc2c
- Type Parameters:
R
-- Parameters:
callable
-- Returns:
-
jc2r
- Parameters:
callable
-- Returns:
-
throwingMerger
- Type Parameters:
T
-- Returns:
-
ignoringMerger
- Type Parameters:
T
-- Returns:
-
replacingMerger
- Type Parameters:
T
-- Returns:
-
getIfPresentOrElseNull
- Type Parameters:
T
-- Returns:
-
getIfPresentOrElseNullJdk
- Type Parameters:
T
-- Returns:
-
isPresent
- Type Parameters:
T
-- Returns:
-
isPresentJdk
- Type Parameters:
T
-- Returns:
-
switchOnNext
Returns a statefulBiFunction
. Don't save or cache for reuse or use it in parallel stream.- Type Parameters:
T
-- Returns:
-
gtAndLt
.