java.lang.Object
flare.commons.FunctionalUtil
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctionalUtil.ExceptionalRunnable<E extends Exception> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,P> Predicate<T> distinct(Function<T, P> propertyExtractor, Consumer<T> dropHandler, Supplier<? extends Set<P>> setFactory) distinctEnum(Function<T, P> propertyExtractor, Consumer<T> dropHandler, Class<P> enumType) static float[]filledArray(int length, float value) static int[]filledArray(int length, int value) static <T> TfindNext(Queue<CompletableFuture<T>> queue, BooleanSupplier hasWork) static <T> TgetRandom(List<T> list, RandomGenerator random) static <T> TgetRandom(T[] array, RandomGenerator random) static <T> Optional<T>getRandomSafe(List<T> list, RandomGenerator random) static <T> Tstatic <T> Tstatic <T extends Enum<T>>
intmapToBits(Collection<T> values, ToIntFunction<T> bitMapper) static <T> Consumer<T>static <V> CompletableFuture<List<V>>sequenceFailFast(List<? extends CompletableFuture<? extends V>> futures) static RunnableuncheckException(FunctionalUtil.ExceptionalRunnable<? extends IOException> runnable) uncheckException(Class<E> exceptionType, FunctionalUtil.ExceptionalRunnable<? extends E> runnable, Function<E, ? extends RuntimeException> exceptionMapper)
-
Method Details
-
uncheckException
public static Runnable uncheckException(FunctionalUtil.ExceptionalRunnable<? extends IOException> runnable) -
uncheckException
public static <E extends Exception> Runnable uncheckException(Class<E> exceptionType, FunctionalUtil.ExceptionalRunnable<? extends E> runnable, Function<E, ? extends RuntimeException> exceptionMapper) -
distinctEnum
-
distinct
-
findNext
-
noopConsumer
-
mapToBits
-
sequenceFailFast
public static <V> CompletableFuture<List<V>> sequenceFailFast(List<? extends CompletableFuture<? extends V>> futures) -
make
-
make
-
filledArray
public static float[] filledArray(int length, float value) -
filledArray
public static int[] filledArray(int length, int value) -
getRandom
-
getRandomSafe
-
getRandom
-