Class Fn

java.lang.Object
com.landawn.abacus.util.Fn

public final class Fn extends Object
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.
 

 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
  • Field Details

  • Method Details

    • memoize

      @Beta @SequentialOnly @Stateful public static <T> Supplier<T> memoize(Supplier<T> supplier)
      Returns a Supplier which returns a single instance created by calling the specified supplier.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:
    • close

      public static Runnable close(AutoCloseable closeable)
      Parameters:
      closeable -
      Returns:
    • closeAll

      @SafeVarargs public static Runnable closeAll(AutoCloseable... a)
      Parameters:
      a -
      Returns:
    • closeAll

      public static Runnable closeAll(Collection<? extends AutoCloseable> c)
      Parameters:
      c -
      Returns:
    • closeQuietly

      public static Runnable closeQuietly(AutoCloseable closeable)
      Parameters:
      closeable -
      Returns:
    • closeAllQuietly

      @SafeVarargs public static Runnable closeAllQuietly(AutoCloseable... a)
      Close all quietly.
      Parameters:
      a -
      Returns:
    • closeAllQuietly

      public static Runnable closeAllQuietly(Collection<? extends AutoCloseable> c)
      Close all quietly.
      Parameters:
      c -
      Returns:
    • emptyAction

      public static Runnable emptyAction()
      Returns:
    • shutDown

      public static Runnable shutDown(ExecutorService service)
      Parameters:
      service -
      Returns:
    • shutDown

      public static Runnable shutDown(ExecutorService service, long terminationTimeout, TimeUnit timeUnit)
      Parameters:
      service -
      terminationTimeout -
      timeUnit -
      Returns:
    • doNothing

      public static <T> Consumer<T> doNothing()
      Type Parameters:
      T -
      Returns:
    • throwRuntimeException

      public static <T> Consumer<T> throwRuntimeException(String errorMessage)
      Type Parameters:
      T -
      Parameters:
      errorMessage -
      Returns:
    • throwException

      public static <T> Consumer<T> throwException(Supplier<? extends RuntimeException> excpetionSupplier)
      Type Parameters:
      T -
      Parameters:
      excpetionSupplier -
      Returns:
    • toRuntimeException

      public static Function<Throwable,RuntimeException> toRuntimeException()
      Returns:
    • close

      public static <T extends AutoCloseable> Consumer<T> close()
      Type Parameters:
      T -
      Returns:
    • closeQuietly

      public static <T extends AutoCloseable> Consumer<T> closeQuietly()
      Type Parameters:
      T -
      Returns:
    • sleep

      public static <T> Consumer<T> sleep(long millis)
      Type Parameters:
      T -
      Parameters:
      millis -
      Returns:
    • sleepUninterruptibly

      public static <T> Consumer<T> sleepUninterruptibly(long millis)
      Type Parameters:
      T -
      Parameters:
      millis -
      Returns:
    • rateLimiter

      @Stateful public static <T> Consumer<T> rateLimiter(double permitsPerSecond)
      Returns a stateful Consumer. Don't save or cache for reuse
      Type Parameters:
      T -
      Parameters:
      permitsPerSecond -
      Returns:
      See Also:
    • rateLimiter

      @Stateful public static <T> Consumer<T> rateLimiter(RateLimiter rateLimiter)
      Returns a stateful Consumer. Don't save or cache for reuse
      Type Parameters:
      T -
      Parameters:
      rateLimiter -
      Returns:
      See Also:
    • println

      public static <T> Consumer<T> println()
      Type Parameters:
      T -
      Returns:
    • println

      public static <T, U> BiConsumer<T,U> println(String separator)
      Type Parameters:
      T -
      U -
      Parameters:
      separator -
      Returns:
    • toStr

      public static <T> Function<T,String> toStr()
      Type Parameters:
      T -
      Returns:
    • toCamelCase

      public static Function<String,String> toCamelCase()
      To camel case.
      Returns:
    • toLowerCase

      public static Function<String,String> toLowerCase()
      To lower case.
      Returns:
    • toLowerCaseWithUnderscore

      public static Function<String,String> toLowerCaseWithUnderscore()
      To lower case with underscore.
      Returns:
    • toUpperCase

      public static Function<String,String> toUpperCase()
      To upper case.
      Returns:
    • toUpperCaseWithUnderscore

      public static Function<String,String> toUpperCaseWithUnderscore()
      To upper case with underscore.
      Returns:
    • toJson

      public static <T> Function<T,String> toJson()
      Type Parameters:
      T -
      Returns:
    • toXml

      public static <T> Function<T,String> toXml()
      Type Parameters:
      T -
      Returns:
    • identity

      public static <T> Function<T,T> identity()
      Type Parameters:
      T -
      Returns:
    • keyed

      public static <K, T> Function<T,Keyed<K,T>> keyed(Function<? super T,K> keyMapper)
      Type Parameters:
      K - the key type
      T -
      Parameters:
      keyMapper -
      Returns:
    • val

      public static <K, T> Function<Keyed<K,T>,T> val()
      Type Parameters:
      K - the key type
      T -
      Returns:
    • kkv

      public static <T, K, V> Function<Map.Entry<Keyed<K,T>,V>,T> kkv()
      Type Parameters:
      T -
      K - the key type
      V - the value type
      Returns:
    • wrap

      public static <T> Function<T,Wrapper<T>> 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

      public static <T> Function<Wrapper<T>,T> unwrap()
      Type Parameters:
      T -
      Returns:
    • key

      public static <K, V> Function<Map.Entry<K,V>,K> key()
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • value

      public static <K, V> Function<Map.Entry<K,V>,V> value()
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • left

      public static <L, R> Function<Pair<L,R>,L> left()
      Type Parameters:
      L -
      R -
      Returns:
    • right

      public static <L, R> Function<Pair<L,R>,R> right()
      Type Parameters:
      L -
      R -
      Returns:
    • inverse

      public static <K, V> Function<Map.Entry<K,V>,Map.Entry<V,K>> inverse()
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • entry

      public static <K, V> BiFunction<K,V,Map.Entry<K,V>> entry()
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • entry

      @Deprecated public static <K, V> Function<V,Map.Entry<K,V>> entry(K key)
      Deprecated.
      replaced by Fn#entryWithKey(Object)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key -
      Returns:
    • entry

      @Deprecated public static <K, V> Function<V,Map.Entry<K,V>> entry(Function<? super V,K> keyMapper)
      Deprecated.
      replaced by Fn#entryByKeyMapper(Function)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyMapper -
      Returns:
    • entryWithKey

      public static <K, V> Function<V,Map.Entry<K,V>> entryWithKey(K key)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      key -
      Returns:
    • entryByKeyMapper

      public static <K, V> Function<V,Map.Entry<K,V>> entryByKeyMapper(Function<? super V,K> keyMapper)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      keyMapper -
      Returns:
    • entryWithValue

      public static <K, V> Function<K,Map.Entry<K,V>> entryWithValue(V value)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      value -
      Returns:
    • entryByValueMapper

      public static <K, V> Function<K,Map.Entry<K,V>> entryByValueMapper(Function<? super K,V> valueMapper)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      valueMapper -
      Returns:
    • pair

      public static <L, R> BiFunction<L,R,Pair<L,R>> pair()
      Type Parameters:
      L -
      R -
      Returns:
    • triple

      public static <L, M, R> TriFunction<L,M,R,Triple<L,M,R>> triple()
      Type Parameters:
      L -
      M -
      R -
      Returns:
    • tuple1

      public static <T> Function<T,Tuple.Tuple1<T>> tuple1()
      Type Parameters:
      T -
      Returns:
    • tuple2

      public static <T, U> BiFunction<T,U,Tuple.Tuple2<T,U>> tuple2()
      Type Parameters:
      T -
      U -
      Returns:
    • tuple3

      public static <A, B, C> TriFunction<A,B,C,Tuple.Tuple3<A,B,C>> tuple3()
      Type Parameters:
      A -
      B -
      C -
      Returns:
    • tuple4

      public static <A, B, C, D> QuadFunction<A,B,C,D,Tuple.Tuple4<A,B,C,D>> tuple4()
      Type Parameters:
      A -
      B -
      C -
      D -
      Returns:
    • trim

      public static Function<String,String> trim()
      Returns:
    • trimToEmpty

      public static Function<String,String> trimToEmpty()
      Returns:
    • trimToNull

      public static Function<String,String> trimToNull()
      Returns:
    • strip

      public static Function<String,String> strip()
      Returns:
    • stripToEmpty

      public static Function<String,String> stripToEmpty()
      Returns:
    • stripToNull

      public static Function<String,String> stripToNull()
      Returns:
    • nullToEmpty

      public static Function<String,String> nullToEmpty()
      Returns:
    • nullToEmptyL

      @Deprecated public static <T> Function<List<T>,List<T>> nullToEmptyL()
      Deprecated.
      replaced by nullToEmptyList
      Type Parameters:
      T -
      Returns:
    • nullToEmptyList

      public static <T> Function<List<T>,List<T>> nullToEmptyList()
      Type Parameters:
      T -
      Returns:
    • nullToEmptyS

      @Deprecated public static <T> Function<Set<T>,Set<T>> nullToEmptyS()
      Deprecated.
      replaced by nullToEmptySet
      Type Parameters:
      T -
      Returns:
    • nullToEmptySet

      public static <T> Function<Set<T>,Set<T>> nullToEmptySet()
      Type Parameters:
      T -
      Returns:
    • nullToEmptyM

      @Deprecated public static <K, V> Function<Map<K,V>,Map<K,V>> nullToEmptyM()
      Deprecated.
      replaced by nullToEmptyMap
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • nullToEmptyMap

      public static <K, V> Function<Map<K,V>,Map<K,V>> nullToEmptyMap()
      Type Parameters:
      K - the key type
      V - the value type
      Returns:
    • len

      public static <T> Function<T[],Integer> len()
      Type Parameters:
      T -
      Returns:
    • length

      public static <T extends CharSequence> Function<T,Integer> length()
      Type Parameters:
      T -
      Returns:
    • size

      public static <T extends Collection> Function<T,Integer> size()
      Type Parameters:
      T -
      Returns:
    • sizeM

      public static <T extends Map> Function<T,Integer> sizeM()
      Type Parameters:
      T -
      Returns:
    • cast

      public static <T, U> Function<T,U> cast(Class<U> clazz)
      Type Parameters:
      T -
      U -
      Parameters:
      clazz -
      Returns:
    • alwaysTrue

      public static <T> Predicate<T> alwaysTrue()
      Type Parameters:
      T -
      Returns:
    • alwaysFalse

      public static <T> Predicate<T> alwaysFalse()
      Type Parameters:
      T -
      Returns:
    • isNull

      public static <T> Predicate<T> isNull()
      Checks if is null.
      Type Parameters:
      T -
      Returns:
    • isNull

      public static <T> Predicate<T> isNull(Function<T,?> valueExtractor)
      Checks if is null.
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • isEmpty

      public static <T extends CharSequence> Predicate<T> isEmpty()
      Checks if is null or empty.
      Type Parameters:
      T -
      Returns:
    • isEmpty

      public static <T> Predicate<T> isEmpty(Function<T,? extends CharSequence> valueExtractor)
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • isBlank

      public static <T extends CharSequence> Predicate<T> isBlank()
      Checks if is null or empty or blank.
      Type Parameters:
      T -
      Returns:
    • isBlank

      public static <T> Predicate<T> isBlank(Function<T,? extends CharSequence> valueExtractor)
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • isEmptyA

      @Beta public static <T> Predicate<T[]> isEmptyA()
      Type Parameters:
      T -
      Returns:
    • isEmptyC

      @Beta public static <T extends Collection> Predicate<T> isEmptyC()
      Type Parameters:
      T -
      Returns:
    • isEmptyM

      @Beta public static <T extends Map> Predicate<T> isEmptyM()
      Type Parameters:
      T -
      Returns:
    • notNull

      public static <T> Predicate<T> notNull()
      Type Parameters:
      T -
      Returns:
    • notNull

      public static <T> Predicate<T> notNull(Function<T,?> valueExtractor)
      Not null.
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • notEmpty

      public static <T extends CharSequence> Predicate<T> notEmpty()
      Not null or empty.
      Type Parameters:
      T -
      Returns:
    • notEmpty

      public static <T> Predicate<T> notEmpty(Function<T,? extends CharSequence> valueExtractor)
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • notBlank

      public static <T extends CharSequence> Predicate<T> notBlank()
      Not null or empty or blank.
      Type Parameters:
      T -
      Returns:
    • notBlank

      public static <T> Predicate<T> notBlank(Function<T,? extends CharSequence> valueExtractor)
      Type Parameters:
      T -
      Parameters:
      valueExtractor -
      Returns:
    • notEmptyA

      @Beta public static <T> Predicate<T[]> notEmptyA()
      Type Parameters:
      T -
      Returns:
    • notEmptyC

      @Beta public static <T extends Collection> Predicate<T> notEmptyC()
      Type Parameters:
      T -
      Returns:
    • notEmptyM

      @Beta public static <T extends Map> Predicate<T> notEmptyM()
      Type Parameters:
      T -
      Returns:
    • isFile

      public static Predicate<File> isFile()
      Checks if is file.
      Returns:
    • isDirectory

      public static Predicate<File> isDirectory()
      Checks if is directory.
      Returns:
    • equal

      public static <T> Predicate<T> equal(Object target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • eqOr

      public static <T> Predicate<T> eqOr(Object targetValue1, Object targetValue2)
      Type Parameters:
      T -
      Parameters:
      targetValue1 -
      targetValue2 -
      Returns:
    • eqOr

      public static <T> Predicate<T> eqOr(Object targetValue1, Object targetValue2, Object targetValue3)
      Type Parameters:
      T -
      Parameters:
      targetValue1 -
      targetValue2 -
      targetValue3 -
      Returns:
    • notEqual

      public static <T> Predicate<T> notEqual(Object target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • greaterThan

      public static <T extends Comparable<? super T>> Predicate<T> greaterThan(T target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • greaterEqual

      public static <T extends Comparable<? super T>> Predicate<T> greaterEqual(T target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • lessThan

      public static <T extends Comparable<? super T>> Predicate<T> lessThan(T target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • lessEqual

      public static <T extends Comparable<? super T>> Predicate<T> lessEqual(T target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • gtAndLt

      public static <T extends Comparable<? super T>> Predicate<T> gtAndLt(T minValue, T maxValue)
      Checks if the value/element: minValue < e < maxValue.
      Type Parameters:
      T -
      Parameters:
      minValue -
      maxValue -
      Returns:
    • geAndLt

      public static <T extends Comparable<? super T>> Predicate<T> geAndLt(T minValue, T maxValue)
      Checks if the value/element: minValue <= e < maxValue.
      Type Parameters:
      T -
      Parameters:
      minValue -
      maxValue -
      Returns:
    • geAndLe

      public static <T extends Comparable<? super T>> Predicate<T> geAndLe(T minValue, T maxValue)
      Checks if the value/element: minValue <= e <= maxValue.
      Type Parameters:
      T -
      Parameters:
      minValue -
      maxValue -
      Returns:
    • gtAndLe

      public static <T extends Comparable<? super T>> Predicate<T> gtAndLe(T minValue, T maxValue)
      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 by gtAndLt.
      Checks if the value/element: minValue < e < maxValue.
      Type Parameters:
      T -
      Parameters:
      minValue -
      maxValue -
      Returns:
    • in

      public static <T> Predicate<T> in(Collection<?> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • notIn

      public static <T> Predicate<T> notIn(Collection<?> c)
      Type Parameters:
      T -
      Parameters:
      c -
      Returns:
    • instanceOf

      public static <T> Predicate<T> instanceOf(Class<?> clazz)
      Type Parameters:
      T -
      Parameters:
      clazz -
      Returns:
    • subtypeOf

      public static Predicate<Class> subtypeOf(Class<?> clazz)
      Parameters:
      clazz -
      Returns:
    • startsWith

      public static Predicate<String> startsWith(String prefix)
      Parameters:
      prefix -
      Returns:
    • endsWith

      public static Predicate<String> endsWith(String suffix)
      Parameters:
      suffix -
      Returns:
    • contains

      public static Predicate<String> contains(String str)
      Parameters:
      str -
      Returns:
    • notStartsWith

      public static Predicate<String> notStartsWith(String prefix)
      Not starts with.
      Parameters:
      prefix -
      Returns:
    • notEndsWith

      public static Predicate<String> notEndsWith(String suffix)
      Not ends with.
      Parameters:
      suffix -
      Returns:
    • notContains

      public static Predicate<String> notContains(String str)
      Parameters:
      str -
      Returns:
    • matches

      public static Predicate<CharSequence> matches(Pattern pattern)
      Parameters:
      pattern -
      Returns:
    • equal

      public static <T, U> BiPredicate<T,U> equal()
      Type Parameters:
      T -
      U -
      Returns:
    • notEqual

      public static <T, U> BiPredicate<T,U> notEqual()
      Type Parameters:
      T -
      U -
      Returns:
    • greaterThan

      public static <T extends Comparable<? super T>> BiPredicate<T,T> greaterThan()
      Type Parameters:
      T -
      Returns:
    • greaterEqual

      public static <T extends Comparable<? super T>> BiPredicate<T,T> greaterEqual()
      Type Parameters:
      T -
      Returns:
    • lessThan

      public static <T extends Comparable<? super T>> BiPredicate<T,T> lessThan()
      Type Parameters:
      T -
      Returns:
    • lessEqual

      public static <T extends Comparable<? super T>> BiPredicate<T,T> lessEqual()
      Type Parameters:
      T -
      Returns:
    • not

      public static <T> Predicate<T> not(Predicate<T> predicate)
      Type Parameters:
      T -
      Parameters:
      predicate -
      Returns:
    • not

      public static <T, U> BiPredicate<T,U> not(BiPredicate<T,U> biPredicate)
      Type Parameters:
      T -
      U -
      Parameters:
      biPredicate -
      Returns:
    • not

      public static <A, B, C> TriPredicate<A,B,C> not(TriPredicate<A,B,C> triPredicate)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      triPredicate -
      Returns:
    • and

      public static BooleanSupplier and(BooleanSupplier first, BooleanSupplier second)
      Parameters:
      first -
      second -
      Returns:
    • and

      public static BooleanSupplier and(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third)
      Parameters:
      first -
      second -
      third -
      Returns:
    • and

      public static <T> Predicate<T> and(Predicate<? super T> first, Predicate<? super T> second)
      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 specified c 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 specified c is null or empty.
    • or

      public static BooleanSupplier or(BooleanSupplier first, BooleanSupplier second)
      Parameters:
      first -
      second -
      Returns:
    • or

      public static BooleanSupplier or(BooleanSupplier first, BooleanSupplier second, BooleanSupplier third)
      Parameters:
      first -
      second -
      third -
      Returns:
    • or

      public static <T> Predicate<T> or(Predicate<? super T> first, Predicate<? super T> second)
      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 specified c 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 specified c is null or empty.
    • testByKey

      public static <K, V> Predicate<Map.Entry<K,V>> testByKey(Predicate<? super K> predicate)
      Test by key.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      predicate -
      Returns:
    • testByValue

      public static <K, V> Predicate<Map.Entry<K,V>> testByValue(Predicate<? super V> predicate)
      Test by value.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      predicate -
      Returns:
    • acceptByKey

      public static <K, V> Consumer<Map.Entry<K,V>> acceptByKey(Consumer<? super K> consumer)
      Accept by key.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      consumer -
      Returns:
    • acceptByValue

      public static <K, V> Consumer<Map.Entry<K,V>> acceptByValue(Consumer<? super V> consumer)
      Accept by value.
      Type Parameters:
      K - the key type
      V - 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

      public static <K, V, R> Function<Map.Entry<K,V>,R> applyByKey(Function<? super K,? extends R> func)
      Apply by key.
      Type Parameters:
      K - the key type
      V - the value type
      R -
      Parameters:
      func -
      Returns:
    • applyByValue

      public static <K, V, R> Function<Map.Entry<K,V>,R> applyByValue(Function<? super V,? extends R> func)
      Apply by value.
      Type Parameters:
      K - the key type
      V - the value type
      R -
      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, R> Function<A,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, 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.
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      defaultValue -
      Returns:
    • applyIfNotNullOrDefault

      public 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.
      Type Parameters:
      A -
      B -
      C -
      D -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      mapperD -
      defaultValue -
      Returns:
    • applyIfNotNullOrElseGet

      public 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.
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      mapperA -
      mapperB -
      supplier -
      Returns:
    • applyIfNotNullOrElseGet

      public 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.
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      supplier -
      Returns:
    • applyIfNotNullOrElseGet

      public 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.
      Type Parameters:
      A -
      B -
      C -
      D -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      mapperD -
      supplier -
      Returns:
    • mapKey

      public static <K, V, KK> Function<Map.Entry<K,V>,Map.Entry<KK,V>> mapKey(Function<? super K,? extends KK> func)
      Type Parameters:
      K - the key type
      V - the value type
      KK -
      Parameters:
      func -
      Returns:
    • mapValue

      public static <K, V, VV> Function<Map.Entry<K,V>,Map.Entry<K,VV>> mapValue(Function<? super V,? extends VV> func)
      Type Parameters:
      K - the key type
      V - the value type
      VV -
      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 type
      V - 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 type
      V - the value type
      Parameters:
      consumer -
      Returns:
    • applyKeyVal

      public static <K, V, R> Function<Map.Entry<K,V>,R> applyKeyVal(BiFunction<? super K,? super V,? extends R> func)
      Apply key val.
      Type Parameters:
      K - the key type
      V - the value type
      R -
      Parameters:
      func -
      Returns:
    • flatToMap

      public static <K, V> Function<? super Map<K,? extends Collection<? extends V>>,List<Map<K,V>>> flatToMap()
      {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 type
      V - the value type
      Returns:
      See Also:
    • parseByte

      public static Function<String,Byte> parseByte()
      Parses the byte.
      Returns:
    • parseShort

      public static Function<String,Short> parseShort()
      Parses the short.
      Returns:
    • parseInt

      public static Function<String,Integer> parseInt()
      Parses the int.
      Returns:
    • parseLong

      public static Function<String,Long> parseLong()
      Parses the long.
      Returns:
    • parseFloat

      public static Function<String,Float> parseFloat()
      Parses the float.
      Returns:
    • parseDouble

      public static Function<String,Double> parseDouble()
      Parses the double.
      Returns:
    • createNumber

      public static Function<String,Number> createNumber()
      Creates the number.
      Returns:
      See Also:
    • numToInt

      public static <T extends Number> ToIntFunction<T> numToInt()
      Num to int.
      Type Parameters:
      T -
      Returns:
    • numToLong

      public static <T extends Number> ToLongFunction<T> numToLong()
      Num to long.
      Type Parameters:
      T -
      Returns:
    • numToDouble

      public static <T extends Number> ToDoubleFunction<T> numToDouble()
      Num to double.
      Type Parameters:
      T -
      Returns:
    • atMost

      @Beta @Stateful public static <T> Predicate<T> atMost(int count)
      Type Parameters:
      T -
      Parameters:
      count -
      Returns:
    • limitThenFilter

      @Beta @SequentialOnly @Stateful public static <T> Predicate<T> limitThenFilter(int limit, Predicate<T> predicate)
      Returns a stateful Predicate. 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 stateful Predicate. 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 stateful Predicate. 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 stateful Predicate. Don't save or cache for reuse or use it in parallel stream.
      Type Parameters:
      T -
      U -
      Parameters:
      predicate -
      limit -
      Returns:
    • timeLimit

      @Beta @SequentialOnly @Stateful public static <T> Predicate<T> timeLimit(long timeInMillis)
      Returns a stateful Predicate. Don't save or cache for reuse or use it in parallel stream.
      Type Parameters:
      T -
      Parameters:
      timeInMillis -
      Returns:
    • timeLimit

      @Beta @SequentialOnly @Stateful public static <T> Predicate<T> timeLimit(Duration duration)
      Returns a stateful Predicate. Don't save or cache for reuse or use it in parallel stream.
      Type Parameters:
      T -
      Parameters:
      duration -
      Returns:
    • indexed

      @Beta @SequentialOnly @Stateful public static <T> Function<T,Indexed<T>> indexed()
      Returns a stateful Predicate. 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 stateful Predicate. Don't save or cache for reuse or use it in parallel stream.
      Type Parameters:
      T -
      Parameters:
      predicate -
      Returns:
    • selectFirst

      public static <T> BinaryOperator<T> selectFirst()
      Type Parameters:
      T -
      Returns:
    • selectSecond

      public static <T> BinaryOperator<T> selectSecond()
      Type Parameters:
      T -
      Returns:
    • min

      public static <T extends Comparable<? super T>> BinaryOperator<T> min()
      Type Parameters:
      T -
      Returns:
    • min

      public static <T> BinaryOperator<T> min(Comparator<? super T> comparator)
      Type Parameters:
      T -
      Parameters:
      comparator -
      Returns:
    • minBy

      public static <T> BinaryOperator<T> minBy(Function<? super T,? extends Comparable> keyMapper)
      Type Parameters:
      T -
      Parameters:
      keyMapper -
      Returns:
    • minByKey

      public static <K extends Comparable<? super K>, V> BinaryOperator<Map.Entry<K,V>> minByKey()
      Type Parameters:
      K -
      V -
      Returns:
    • minByValue

      public static <K, V extends Comparable<? super V>> BinaryOperator<Map.Entry<K,V>> minByValue()
      Type Parameters:
      K -
      V -
      Returns:
    • max

      public static <T extends Comparable<? super T>> BinaryOperator<T> max()
      Type Parameters:
      T -
      Returns:
    • max

      public static <T> BinaryOperator<T> max(Comparator<? super T> comparator)
      Type Parameters:
      T -
      Parameters:
      comparator -
      Returns:
    • maxBy

      public static <T> BinaryOperator<T> maxBy(Function<? super T,? extends Comparable> keyMapper)
      Type Parameters:
      T -
      Parameters:
      keyMapper -
      Returns:
    • maxByKey

      public static <K extends Comparable<? super K>, V> BinaryOperator<Map.Entry<K,V>> maxByKey()
      Type Parameters:
      K -
      V -
      Returns:
    • maxByValue

      public static <K, V extends Comparable<? super V>> BinaryOperator<Map.Entry<K,V>> maxByValue()
      Type Parameters:
      K -
      V -
      Returns:
    • compareTo

      public static <T extends Comparable<? super T>> Function<T,Integer> compareTo(T target)
      Type Parameters:
      T -
      Parameters:
      target -
      Returns:
    • compareTo

      public static <T> Function<T,Integer> compareTo(T target, Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      target -
      cmp -
      Returns:
    • compare

      public static <T extends Comparable<? super T>> BiFunction<T,T,Integer> compare()
      Type Parameters:
      T -
      Returns:
    • compare

      public static <T> BiFunction<T,T,Integer> compare(Comparator<? super T> cmp)
      Type Parameters:
      T -
      Parameters:
      cmp -
      Returns:
    • futureGetOrDefaultOnError

      @Beta public static <T> Function<Future<T>,T> futureGetOrDefaultOnError(T defaultValue)
      Type Parameters:
      T -
      Parameters:
      defaultValue -
      Returns:
    • futureGet

      @Beta public static <T> Function<Future<T>,T> futureGet()
      Type Parameters:
      T -
      Returns:
    • from

      @Beta public static <T> Supplier<T> from(Supplier<T> supplier)
      Type Parameters:
      T -
      Parameters:
      supplier -
      Returns:
    • from

      @Beta public static <T> IntFunction<T> from(IntFunction<? extends T> func)
      Type Parameters:
      T -
      Parameters:
      func -
      Returns:
    • from

      @Beta public static <T> Predicate<T> from(Predicate<T> predicate)
      Type Parameters:
      T -
      Parameters:
      predicate -
      Returns:
    • from

      @Beta public static <T, U> BiPredicate<T,U> from(BiPredicate<T,U> predicate)
      Type Parameters:
      T -
      U -
      Parameters:
      predicate -
      Returns:
    • from

      @Beta public static <T> Consumer<T> from(Consumer<T> consumer)
      Type Parameters:
      T -
      Parameters:
      consumer -
      Returns:
    • from

      @Beta public static <T, U> BiConsumer<T,U> from(BiConsumer<T,U> consumer)
      Type Parameters:
      T -
      U -
      Parameters:
      consumer -
      Returns:
    • from

      @Beta public static <T, R> Function<T,R> from(Function<T,? extends R> function)
      Type Parameters:
      T -
      R -
      Parameters:
      function -
      Returns:
    • from

      @Beta public static <T, U, R> BiFunction<T,U,R> from(BiFunction<T,U,? extends R> function)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      function -
      Returns:
    • from

      @Beta public static <T> UnaryOperator<T> from(UnaryOperator<T> op)
      Type Parameters:
      T -
      Parameters:
      op -
      Returns:
    • from

      @Beta public static <T> BinaryOperator<T> from(BinaryOperator<T> op)
      Type Parameters:
      T -
      Parameters:
      op -
      Returns:
    • p

      @Beta public static <T> Predicate<T> p(Predicate<T> predicate)
      Type Parameters:
      T -
      Parameters:
      predicate -
      Returns:
    • p

      @Beta public static <A, T> Predicate<T> p(A a, BiPredicate<A,T> biPredicate)
      Type Parameters:
      A -
      T -
      Parameters:
      a -
      biPredicate -
      Returns:
    • p

      @Beta public static <A, B, T> Predicate<T> p(A a, B b, TriPredicate<A,B,T> triPredicate)
      Type Parameters:
      A -
      B -
      T -
      Parameters:
      a -
      b -
      triPredicate -
      Returns:
    • p

      @Beta public static <T, U> BiPredicate<T,U> p(BiPredicate<T,U> biPredicate)
      Type Parameters:
      T -
      U -
      Parameters:
      biPredicate -
      Returns:
    • p

      @Beta public static <A, T, U> BiPredicate<T,U> p(A a, TriPredicate<A,T,U> triPredicate)
      Type Parameters:
      A -
      T -
      U -
      Parameters:
      a -
      triPredicate -
      Returns:
    • p

      @Beta public static <A, B, C> TriPredicate<A,B,C> p(TriPredicate<A,B,C> triPredicate)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      triPredicate -
      Returns:
    • c

      @Beta public static <T> Consumer<T> c(Consumer<T> predicate)
      Type Parameters:
      T -
      Parameters:
      predicate -
      Returns:
    • c

      @Beta public static <A, T> Consumer<T> c(A a, BiConsumer<A,T> biConsumer)
      Type Parameters:
      A -
      T -
      Parameters:
      a -
      biConsumer -
      Returns:
    • c

      @Beta public static <A, B, T> Consumer<T> c(A a, B b, TriConsumer<A,B,T> triConsumer)
      Type Parameters:
      A -
      B -
      T -
      Parameters:
      a -
      b -
      triConsumer -
      Returns:
    • c

      @Beta public static <T, U> BiConsumer<T,U> c(BiConsumer<T,U> biConsumer)
      Type Parameters:
      T -
      U -
      Parameters:
      biConsumer -
      Returns:
    • c

      @Beta public static <A, T, U> BiConsumer<T,U> c(A a, TriConsumer<A,T,U> triConsumer)
      Type Parameters:
      A -
      T -
      U -
      Parameters:
      a -
      triConsumer -
      Returns:
    • c

      @Beta public static <A, B, C> TriConsumer<A,B,C> c(TriConsumer<A,B,C> triConsumer)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      triConsumer -
      Returns:
    • f

      @Beta public static <T, R> Function<T,R> f(Function<T,R> predicate)
      Type Parameters:
      T -
      R -
      Parameters:
      predicate -
      Returns:
    • f

      @Beta public static <A, T, R> Function<T,R> f(A a, BiFunction<A,T,R> biFunction)
      Type Parameters:
      A -
      T -
      R -
      Parameters:
      a -
      biFunction -
      Returns:
    • f

      @Beta public static <A, B, T, R> Function<T,R> f(A a, B b, TriFunction<A,B,T,R> triFunction)
      Type Parameters:
      A -
      B -
      T -
      R -
      Parameters:
      a -
      b -
      triFunction -
      Returns:
    • f

      @Beta public static <T, U, R> BiFunction<T,U,R> f(BiFunction<T,U,R> biFunction)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      biFunction -
      Returns:
    • f

      @Beta public static <A, T, U, R> BiFunction<T,U,R> f(A a, TriFunction<A,T,U,R> triFunction)
      Type Parameters:
      A -
      T -
      U -
      R -
      Parameters:
      a -
      triFunction -
      Returns:
    • f

      @Beta public static <A, B, C, R> TriFunction<A,B,C,R> f(TriFunction<A,B,C,R> triFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      triFunction -
      Returns:
    • pp

      @Beta public static <T> Predicate<T> pp(Throwables.Predicate<T,? extends Exception> predicate)
      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, T> Predicate<T> pp(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, U> BiPredicate<T,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, C> TriPredicate<A,B,C> pp(Throwables.TriPredicate<A,B,C,? extends Exception> triPredicate)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      triPredicate -
      Returns:
    • cc

      @Beta public static <T> Consumer<T> cc(Throwables.Consumer<T,? extends Exception> consumer)
      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, T> Consumer<T> cc(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, U> BiConsumer<T,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, C> TriConsumer<A,B,C> cc(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, R> Function<T,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, T, R> Function<T,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, R> BiFunction<T,U,R> ff(Throwables.BiFunction<T,U,R,? extends Exception> biFunction)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      biFunction -
      Returns:
    • ff

      @Beta public static <T, U, R> BiFunction<T,U,R> ff(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, U, R> BiFunction<T,U,R> ff(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, C, R> TriFunction<A,B,C,R> ff(Throwables.TriFunction<A,B,C,R,? extends Exception> triFunction)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      triFunction -
      Returns:
    • ff

      @Beta public static <A, B, C, R> TriFunction<A,B,C,R> ff(Throwables.TriFunction<A,B,C,R,? extends Exception> triFunction, R defaultOnError)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      triFunction -
      defaultOnError -
      Returns:
    • sp

      @Beta public static <T> Predicate<T> sp(Object mutex, Predicate<T> predicate)
      Synchronized Predicate.
      Type Parameters:
      T -
      Parameters:
      mutex - to synchronized on
      predicate -
      Returns:
    • sp

      @Beta public static <A, T> Predicate<T> sp(Object mutex, A a, BiPredicate<A,T> biPredicate)
      Synchronized Predicate.
      Type Parameters:
      A -
      T -
      Parameters:
      mutex - to synchronized on
      a -
      biPredicate -
      Returns:
    • sp

      @Beta public static <A, B, T> Predicate<T> sp(Object mutex, A a, B b, TriPredicate<A,B,T> triPredicate)
      Synchronized Predicate.
      Type Parameters:
      A -
      B -
      T -
      Parameters:
      mutex - to synchronized on
      a -
      b -
      triPredicate -
      Returns:
    • sp

      @Beta public static <T, U> BiPredicate<T,U> sp(Object mutex, BiPredicate<T,U> biPredicate)
      Synchronized BiPredicate.
      Type Parameters:
      T -
      U -
      Parameters:
      mutex - to synchronized on
      biPredicate -
      Returns:
    • sc

      @Beta public static <T> Consumer<T> sc(Object mutex, Consumer<T> consumer)
      Synchronized Consumer.
      Type Parameters:
      T -
      Parameters:
      mutex - to synchronized on
      consumer -
      Returns:
    • sc

      @Beta public static <A, T> Consumer<T> sc(Object mutex, A a, BiConsumer<A,T> biConsumer)
      Synchronized Consumer.
      Type Parameters:
      A -
      T -
      Parameters:
      mutex - to synchronized on
      a -
      biConsumer -
      Returns:
    • sc

      @Beta public static <T, U> BiConsumer<T,U> sc(Object mutex, BiConsumer<T,U> biConsumer)
      Synchronized BiConsumer.
      Type Parameters:
      T -
      U -
      Parameters:
      mutex - to synchronized on
      biConsumer -
      Returns:
    • sf

      @Beta public static <T, R> Function<T,R> sf(Object mutex, Function<T,? extends R> function)
      Synchronized Function.
      Type Parameters:
      T -
      R -
      Parameters:
      mutex - to synchronized on
      function -
      Returns:
    • sf

      @Beta public static <A, T, R> Function<T,R> sf(Object mutex, A a, BiFunction<A,T,R> biFunction)
      Synchronized Function.
      Type Parameters:
      A -
      T -
      R -
      Parameters:
      mutex - to synchronized on
      a -
      biFunction -
      Returns:
    • sf

      @Beta public static <T, U, R> BiFunction<T,U,R> sf(Object mutex, BiFunction<T,U,R> biFunction)
      Synchronized BiFunction.
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      mutex - to synchronized on
      biFunction -
      Returns:
    • c2f

      public static <T> Function<T,Void> c2f(Consumer<? super T> action)
      Type Parameters:
      T -
      Parameters:
      action -
      Returns:
    • c2f

      public static <T, R> Function<T,R> c2f(Consumer<? super T> action, R valueToReturn)
      Type Parameters:
      T -
      R -
      Parameters:
      action -
      valueToReturn -
      Returns:
    • c2f

      public static <T, U> BiFunction<T,U,Void> c2f(BiConsumer<? super T,? super U> action)
      Type Parameters:
      T -
      U -
      Parameters:
      action -
      Returns:
    • c2f

      public static <T, U, R> BiFunction<T,U,R> c2f(BiConsumer<? super T,? super U> action, R valueToReturn)
      Type Parameters:
      T -
      U -
      R -
      Parameters:
      action -
      valueToReturn -
      Returns:
    • c2f

      public static <A, B, C> TriFunction<A,B,C,Void> c2f(TriConsumer<? super A,? super B,? super C> action)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      action -
      Returns:
    • c2f

      public static <A, B, C, R> TriFunction<A,B,C,R> c2f(TriConsumer<? super A,? super B,? super C> action, R valueToReturn)
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      action -
      valueToReturn -
      Returns:
    • f2c

      public static <T> Consumer<T> f2c(Function<? super T,?> func)
      Returns a Consumer which calls the specified func.
      Type Parameters:
      T -
      Parameters:
      func -
      Returns:
    • f2c

      public static <T, U> BiConsumer<T,U> f2c(BiFunction<? super T,? super U,?> func)
      Type Parameters:
      T -
      U -
      Parameters:
      func -
      Returns:
    • f2c

      public static <A, B, C> TriConsumer<A,B,C> f2c(TriFunction<? super A,? super B,? super C,?> func)
      Type Parameters:
      A -
      B -
      C -
      Parameters:
      func -
      Returns:
    • rr

      public static Runnable rr(Throwables.Runnable<? extends Exception> runnbale)
      Parameters:
      runnbale -
      Returns:
    • cc

      public static <R> Callable<R> cc(Throwables.Callable<R,? extends Exception> callable)
      Type Parameters:
      R -
      Parameters:
      callable -
      Returns:
    • r

      public static Runnable r(Runnable runnable)
      Parameters:
      runnable -
      Returns:
    • c

      public static <R> Callable<R> c(Callable<R> callable)
      Type Parameters:
      R -
      Parameters:
      callable -
      Returns:
    • jr

      public static Runnable jr(Runnable runnable)
      Parameters:
      runnable -
      Returns:
    • jc

      public static <R> Callable<R> jc(Callable<R> callable)
      Type Parameters:
      R -
      Parameters:
      callable -
      Returns:
    • r2c

      public static Callable<Void> r2c(Runnable runnable)
      Parameters:
      runnable -
      Returns:
    • r2c

      public static <R> Callable<R> r2c(Runnable runnable, R valueToReturn)
      Type Parameters:
      R -
      Parameters:
      runnable -
      valueToReturn -
      Returns:
    • c2r

      public static <R> Runnable c2r(Callable<R> callable)
      Type Parameters:
      R -
      Parameters:
      callable -
      Returns:
    • jr2r

      public static Runnable jr2r(Runnable runnable)
      Parameters:
      runnable -
      Returns:
    • jc2c

      public static <R> Callable<R> jc2c(Callable<R> callable)
      Type Parameters:
      R -
      Parameters:
      callable -
      Returns:
    • jc2r

      public static Runnable jc2r(Callable<?> callable)
      Parameters:
      callable -
      Returns:
    • throwingMerger

      public static <T> BinaryOperator<T> throwingMerger()
      Type Parameters:
      T -
      Returns:
    • ignoringMerger

      public static <T> BinaryOperator<T> ignoringMerger()
      Type Parameters:
      T -
      Returns:
    • replacingMerger

      public static <T> BinaryOperator<T> replacingMerger()
      Type Parameters:
      T -
      Returns:
    • getIfPresentOrElseNull

      public static <T> Function<u.Optional<? extends T>,T> getIfPresentOrElseNull()
      Type Parameters:
      T -
      Returns:
    • getIfPresentOrElseNullJdk

      public static <T> Function<Optional<? extends T>,T> getIfPresentOrElseNullJdk()
      Type Parameters:
      T -
      Returns:
    • isPresent

      public static <T> Predicate<u.Optional<? extends T>> isPresent()
      Type Parameters:
      T -
      Returns:
    • isPresentJdk

      public static <T> Predicate<Optional<? extends T>> isPresentJdk()
      Type Parameters:
      T -
      Returns:
    • switchOnNext

      @Beta @SequentialOnly @Stateful public static <T> BiFunction<T,T,MergeResult> switchOnNext()
      Returns a stateful BiFunction. Don't save or cache for reuse or use it in parallel stream.
      Type Parameters:
      T -
      Returns: