Class Fn


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

    • get

      public static <T> T get(Supplier<T> supplier)
      Type Parameters:
      T -
      Parameters:
      supplier -
      Returns:
    • 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:
    • reuse

      @Deprecated @Beta @SequentialOnly @Stateful public static <T, C extends Collection<T>> Supplier<? extends C> reuse(Supplier<? extends C> supplier)
      Deprecated.
      Only for temporary use in sequential stream/single thread, not for parallel stream/multiple threads. The returned Collection will clean up before it's returned every time when get is called. Don't save the returned Collection object or use it to save objects.
      Type Parameters:
      T -
      C -
      Parameters:
      supplier -
      Returns:
    • reuse

      @Deprecated @Beta @SequentialOnly @Stateful public static <T, C extends Collection<T>> IntFunction<? extends C> reuse(IntFunction<? extends C> supplier)
      Deprecated.
      Only for temporary use in sequential stream/single thread, not for parallel stream/multiple threads. The returned Collection will clean up before it's returned every time when get is called. Don't save the returned Collection object or use it to save objects.
      Type Parameters:
      T -
      C -
      Parameters:
      supplier -
      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()
    • shutDown

      public static Runnable shutDown(ExecutorService service)
    • shutDown

      public static Runnable shutDown(ExecutorService service, long terminationTimeout, TimeUnit timeUnit)
    • 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()
    • 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:
      rateLimiter -
      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:
    • 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:
      K - the key type
      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()
    • right

      public static <L, R> Function<Pair<L,R>,R> right()
    • 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()
    • trimToEmpty

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

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

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

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

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

      public static Function<String,String> nullToEmpty()
    • 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:
    • length

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

      public static <T> Function<T[],Integer> len()
      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:
    • isNullOrEmpty

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

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

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

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

      @Beta public static <T> Predicate<T[]> isNullOrEmptyA()
    • isNullOrEmptyC

      @Beta public static <T extends Collection> Predicate<T> isNullOrEmptyC()
    • isNullOrEmptyM

      @Beta public static <T extends Map> Predicate<T> isNullOrEmptyM()
    • 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:
    • notNullOrEmpty

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

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

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

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

      @Beta public static <T> Predicate<T[]> notNullOrEmptyA()
    • notNullOrEmptyC

      @Beta public static <T extends Collection> Predicate<T> notNullOrEmptyC()
    • notNullOrEmptyM

      @Beta public static <T extends Map> Predicate<T> notNullOrEmptyM()
    • 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)
    • acceptIfOrElse

      @Beta public static <T> Consumer<T> acceptIfOrElse(Predicate<? super T> predicate, Consumer<? super T> consumerForTrue, Consumer<? super T> consumerForFalse)
    • applyByKey

      public static <K, V, R> Function<Map.Entry<K,V>,R> applyByKey(Function<? super K,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,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,R> func, R defaultValue)
    • applyIfOrElseGet

      @Beta public static <T, R> Function<T,R> applyIfOrElseGet(Predicate<? super T> predicate, Function<? super T,R> func, Supplier<? extends R> supplier)
    • applyIfNotNullOrDefault

      public static <A, B, R> Function<A,R> applyIfNotNullOrDefault(Function<A,B> mapperA, Function<B,R> mapperB, R defaultValue)
      Apply if not null or default.
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      mapperA -
      mapperB -
      defaultValue -
      Returns:
    • applyIfNotNullOrDefault

      public static <A, B, C, R> Function<A,R> applyIfNotNullOrDefault(Function<A,B> mapperA, Function<B,C> mapperB, Function<C,R> mapperC, R defaultValue)
      Apply if not null or default.
      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,R> mapperD, R defaultValue)
      Apply if not null or default.
      Type Parameters:
      A -
      B -
      C -
      D -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      mapperD -
      defaultValue -
      Returns:
    • applyIfNotNullOrGet

      public static <A, B, R> Function<A,R> applyIfNotNullOrGet(Function<A,B> mapperA, Function<B,R> mapperB, Supplier<R> supplier)
      Apply if not null or get.
      Type Parameters:
      A -
      B -
      R -
      Parameters:
      mapperA -
      mapperB -
      supplier -
      Returns:
    • applyIfNotNullOrGet

      public static <A, B, C, R> Function<A,R> applyIfNotNullOrGet(Function<A,B> mapperA, Function<B,C> mapperB, Function<C,R> mapperC, Supplier<R> supplier)
      Apply if not null or get.
      Type Parameters:
      A -
      B -
      C -
      R -
      Parameters:
      mapperA -
      mapperB -
      mapperC -
      supplier -
      Returns:
    • applyIfNotNullOrGet

      public static <A, B, C, D, R> Function<A,R> applyIfNotNullOrGet(Function<A,B> mapperA, Function<B,C> mapperB, Function<C,D> mapperC, Function<D,R> mapperD, Supplier<R> supplier)
      Apply if not null or get.
      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,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:
    • 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(IndexedPredicate<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 -
      U -
      Returns:
    • selectSecond

      public static <T> BinaryOperator<T> selectSecond()
      Type Parameters:
      T -
      U -
      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:
      comparator -
      Returns:
    • minByKey

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

      public static <K, V extends Comparable<? super V>> BinaryOperator<Map.Entry<K,V>> minByValue()
      Type Parameters:
      T -
      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:
      comparator -
      Returns:
    • maxByKey

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

      public static <K, V extends Comparable<? super V>> BinaryOperator<Map.Entry<K,V>> maxByValue()
      Type Parameters:
      T -
      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<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,R> function)
      Type Parameters:
      T -
      R -
      Parameters:
      function -
      Returns:
    • from

      @Beta public static <T, U, R> BiFunction<T,U,R> from(BiFunction<T,U,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, E extends Exception> Predicate<T> pp(Throwables.Predicate<T,E> predicate)
      Type Parameters:
      T -
      E -
      Parameters:
      predicate -
      Returns:
    • pp

      @Beta public static <A, T, E extends Exception> Predicate<T> pp(A a, Throwables.BiPredicate<A,T,E> biPredicate)
      Type Parameters:
      A -
      T -
      E -
      Parameters:
      a -
      biPredicate -
      Returns:
    • pp

      @Beta public static <A, B, T, E extends Exception> Predicate<T> pp(A a, B b, Throwables.TriPredicate<A,B,T,E> triPredicate)
      Type Parameters:
      A -
      B -
      T -
      E -
      Parameters:
      a -
      b -
      triPredicate -
      Returns:
    • pp

      @Beta public static <T, U, E extends Exception> BiPredicate<T,U> pp(Throwables.BiPredicate<T,U,E> biPredicate)
      Type Parameters:
      T -
      U -
      E -
      Parameters:
      biPredicate -
      Returns:
    • pp

      @Beta public static <A, T, U, E extends Exception> BiPredicate<T,U> pp(A a, Throwables.TriPredicate<A,T,U,E> triPredicate)
      Type Parameters:
      A -
      T -
      U -
      E -
      Parameters:
      a -
      triPredicate -
      Returns:
    • pp

      @Beta public static <A, B, C, E extends Exception> TriPredicate<A,B,C> pp(Throwables.TriPredicate<A,B,C,E> triPredicate)
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      triPredicate -
      Returns:
    • cc

      @Beta public static <T, E extends Exception> Consumer<T> cc(Throwables.Consumer<T,E> consumer)
      Type Parameters:
      T -
      E -
      Parameters:
      consumer -
      Returns:
    • cc

      @Beta public static <A, T, E extends Exception> Consumer<T> cc(A a, Throwables.BiConsumer<A,T,E> biConsumer)
      Type Parameters:
      A -
      T -
      E -
      Parameters:
      a -
      biConsumer -
      Returns:
    • cc

      @Beta public static <A, B, T, E extends Exception> Consumer<T> cc(A a, B b, Throwables.TriConsumer<A,B,T,E> triConsumer)
      Type Parameters:
      A -
      B -
      T -
      E -
      Parameters:
      a -
      b -
      triConsumer -
      Returns:
    • cc

      @Beta public static <T, U, E extends Exception> BiConsumer<T,U> cc(Throwables.BiConsumer<T,U,E> biConsumer)
      Type Parameters:
      T -
      U -
      E -
      Parameters:
      biConsumer -
      Returns:
    • cc

      @Beta public static <A, T, U, E extends Exception> BiConsumer<T,U> cc(A a, Throwables.TriConsumer<A,T,U,E> triConsumer)
      Type Parameters:
      A -
      T -
      U -
      E -
      Parameters:
      a -
      triConsumer -
      Returns:
    • cc

      @Beta public static <A, B, C, E extends Exception> TriConsumer<A,B,C> cc(Throwables.TriConsumer<A,B,C,E> triConsumer)
      Type Parameters:
      A -
      B -
      C -
      E -
      Parameters:
      triConsumer -
      Returns:
    • ff

      @Beta public static <T, R, E extends Exception> Function<T,R> ff(Throwables.Function<T,R,E> function)
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      function -
      Returns:
    • ff

      @Beta public static <T, R, E extends Exception> Function<T,R> ff(Throwables.Function<T,R,E> function, R defaultOnError)
      Type Parameters:
      T -
      R -
      E -
      Parameters:
      function -
      defaultOnError -
      Returns:
    • ff

      @Beta public static <A, T, R, E extends Exception> Function<T,R> ff(A a, Throwables.BiFunction<A,T,R,E> biFunction)
      Type Parameters:
      A -
      T -
      R -
      E -
      Parameters:
      a -
      biFunction -
      Returns:
    • ff

      @Beta public static <A, B, T, R, E extends Exception> Function<T,R> ff(A a, B b, Throwables.TriFunction<A,B,T,R,E> triFunction)
      Type Parameters:
      A -
      B -
      T -
      R -
      E -
      Parameters:
      a -
      b -
      triFunction -
      Returns:
    • ff

      @Beta public static <T, U, R, E extends Exception> BiFunction<T,U,R> ff(Throwables.BiFunction<T,U,R,E> biFunction)
      Type Parameters:
      T -
      U -
      R -
      E -
      Parameters:
      biFunction -
      Returns:
    • ff

      @Beta public static <T, U, R, E extends Exception> BiFunction<T,U,R> ff(Throwables.BiFunction<T,U,R,E> biFunction, R defaultOnError)
      Type Parameters:
      T -
      U -
      R -
      E -
      Parameters:
      biFunction -
      defaultOnError -
    • ff

      @Beta public static <A, T, U, R, E extends Exception> BiFunction<T,U,R> ff(A a, Throwables.TriFunction<A,T,U,R,E> triFunction)
      Type Parameters:
      A -
      T -
      U -
      R -
      E -
      Parameters:
      a -
      triFunction -
      Returns:
    • ff

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

      @Beta public static <A, B, C, R, E extends Exception> TriFunction<A,B,C,R> ff(Throwables.TriFunction<A,B,C,R,E> triFunction, R defaultOnError)
      Type Parameters:
      A -
      B -
      C -
      R -
      E -
      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,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)
    • c2f

      public static <T, R> Function<T,R> c2f(Consumer<? super T> action, R valueToReturn)
    • c2f

      public static <T, U> BiFunction<T,U,Void> c2f(BiConsumer<? super T,? super U> action)
    • c2f

      public static <T, U, R> BiFunction<T,U,R> c2f(BiConsumer<? super T,? super U> action, R valueToReturn)
    • c2f

      public static <A, B, C> TriFunction<A,B,C,Void> c2f(TriConsumer<? super A,? super B,? super C> action)
    • c2f

      public static <A, B, C, R> TriFunction<A,B,C,R> c2f(TriConsumer<? super A,? super B,? super C> action, R valueToReturn)
    • 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)
    • f2c

      public static <A, B, C> TriConsumer<A,B,C> f2c(TriFunction<? super A,? super B,? super C,?> func)
    • rr

      public static <E extends Exception> Runnable rr(Throwables.Runnable<E> runnbale)
    • cc

      public static <R, E extends Exception> Callable<R> cc(Throwables.Callable<R,E> callable)
    • 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:
    • r2c

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

      public static <R> Callable<R> r2c(Runnable runnable, R valueToReturn)
      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)
    • jc2c

      public static <R> Callable<R> jc2c(Callable<R> callable)
    • jc2r

      public static Runnable jc2r(Callable<?> callable)
    • 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()
    • getIfPresentOrElseNullJdk

      public static <T> Function<Optional<? extends T>,T> getIfPresentOrElseNullJdk()
    • isPresent

      public static <T> Predicate<u.Optional<? extends T>> isPresent()
    • isPresentJdk

      public static <T> Predicate<Optional<? extends T>> isPresentJdk()
    • 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: