Class Functions
java.lang.Object
io.reactivex.rxjava3.internal.functions.Functions
Utility methods to convert the BiFunction, Function3..Function9 instances to Function of Object array.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Actionstatic final LongConsumerstatic final RunnableWraps the consumed Throwable into an OnErrorNotImplementedException and signals it to the plugin error handler.static final Consumer<org.reactivestreams.Subscription> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Consumer<T> actionConsumer(Action action) static <T> Consumer<T> boundedConsumer(int bufferSize) castFunction(@NonNull Class<U> target) Returns a function that cast the incoming values via a Class object.createArrayList(int capacity) static <T> Consumer<T> Returns an empty consumer that does nothing.static <T> Predicate<T> equalsWith(T value) futureAction(@NonNull Future<?> future) Wraps the blocking get call of the Future into an Action.identity()Returns an identity function that simply returns its argument.static <T,U> Predicate <T> isInstanceOf(Class<U> clazz) justCallable(T value) Returns a Callable that returns the given value.justFunction(U value) Returns a Function that ignores its parameter and returns the given value.justSupplier(T value) Returns a Supplier that returns the given value.listSorter(Comparator<? super T> comparator) static <T> Comparator<T> static <T> ActionnotificationOnComplete(Consumer<? super Notification<T>> onNotification) notificationOnError(Consumer<? super Notification<T>> onNotification) static <T> Consumer<T> notificationOnNext(Consumer<? super Notification<T>> onNotification) static <T> Predicate<T> predicateReverseFor(BooleanSupplier supplier) timestampWith(TimeUnit unit, Scheduler scheduler) toFunction(@NonNull BiFunction<? super T1, ? super T2, ? extends R> f) toFunction(@NonNull Function3<T1, T2, T3, R> f) toFunction(@NonNull Function4<T1, T2, T3, T4, R> f) toFunction(@NonNull Function5<T1, T2, T3, T4, T5, R> f) toFunction(@NonNull Function6<T1, T2, T3, T4, T5, T6, R> f) toFunction(@NonNull Function7<T1, T2, T3, T4, T5, T6, T7, R> f) toFunction(@NonNull Function8<T1, T2, T3, T4, T5, T6, T7, T8, R> f) toFunction(@NonNull Function9<T1, T2, T3, T4, T5, T6, T7, T8, T9, R> f) static <T,K> BiConsumer <Map<K, T>, T> toMapKeySelector(Function<? super T, ? extends K> keySelector) static <T,K, V> BiConsumer <Map<K, V>, T> toMapKeyValueSelector(Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector) static <T,K, V> BiConsumer <Map<K, Collection<V>>, T> toMultimapKeyValueSelector(Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, Function<? super K, ? extends Collection<? super V>> collectionFactory)
-
Field Details
-
EMPTY_RUNNABLE
-
EMPTY_ACTION
-
ERROR_CONSUMER
-
ON_ERROR_MISSING
-
EMPTY_LONG_CONSUMER
-
REQUEST_MAX
-
-
Method Details
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
identity
-
emptyConsumer
Returns an empty consumer that does nothing.- Type Parameters:
T- the consumed value type, the value is ignored- Returns:
- an empty consumer that does nothing.
-
alwaysTrue
-
alwaysFalse
-
nullSupplier
-
futureAction
-
justCallable
-
justSupplier
-
justFunction
Returns a Function that ignores its parameter and returns the given value.- Type Parameters:
T- the function's input typeU- the value and return type of the function- Parameters:
value- the value to return- Returns:
- the new Function instance
-
castFunction
Returns a function that cast the incoming values via a Class object.- Type Parameters:
T- the input value typeU- the output and target type- Parameters:
target- the target class- Returns:
- the new Function instance
-
createArrayList
-
equalsWith
-
createHashSet
-
notificationOnNext
-
notificationOnError
public static <T> Consumer<Throwable> notificationOnError(Consumer<? super Notification<T>> onNotification) -
notificationOnComplete
-
actionConsumer
-
isInstanceOf
-
predicateReverseFor
-
timestampWith
-
toMapKeySelector
public static <T,K> BiConsumer<Map<K,T>, toMapKeySelectorT> (Function<? super T, ? extends K> keySelector) -
toMapKeyValueSelector
public static <T,K, BiConsumer<Map<K,V> V>, toMapKeyValueSelectorT> (Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector) -
toMultimapKeyValueSelector
public static <T,K, BiConsumer<Map<K, Collection<V>>, T> toMultimapKeyValueSelectorV> (Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, Function<? super K, ? extends Collection<? super V>> collectionFactory) -
naturalComparator
-
listSorter
-
boundedConsumer
-