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 ClassesModifier and TypeClassDescription(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
static class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static enum
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static enum
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Action
static final LongConsumer
static final Runnable
A singleton identity function.Wraps the consumed Throwable into an OnErrorNotImplementedException and signals it to the plugin error handler.static final Consumer
<org.reactivestreams.Subscription> -
Constructor Summary
Constructors -
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> Action
notificationOnComplete
(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
-
IDENTITY
A singleton identity function. -
EMPTY_RUNNABLE
-
EMPTY_ACTION
-
EMPTY_CONSUMER
-
ERROR_CONSUMER
-
ON_ERROR_MISSING
Wraps the consumed Throwable into an OnErrorNotImplementedException and signals it to the plugin error handler. -
EMPTY_LONG_CONSUMER
-
ALWAYS_TRUE
-
ALWAYS_FALSE
-
NULL_SUPPLIER
-
REQUEST_MAX
-
-
Constructor Details
-
Functions
private Functions()Utility class.
-
-
Method Details
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
toFunction
-
identity
Returns an identity function that simply returns its argument.- Type Parameters:
T
- the input and output value type- Returns:
- the identity function
-
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
Wraps the blocking get call of the Future into an Action.- Parameters:
future
- the future to call get() on, not null- Returns:
- the new Action instance
-
justCallable
Returns a Callable that returns the given value.- Type Parameters:
T
- the value type- Parameters:
value
- the value to return- Returns:
- the new Callable instance
-
justSupplier
Returns a Supplier that returns the given value.- Type Parameters:
T
- the value type- Parameters:
value
- the value to return- Returns:
- the new Callable instance
-
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
@NonNull public static <T,U> @NonNull Function<T,U> castFunction(@NonNull @NonNull Class<U> target) 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,V> Collection<V>>, toMultimapKeyValueSelectorT> (Function<? super T, ? extends K> keySelector, Function<? super T, ? extends V> valueSelector, Function<? super K, ? extends Collection<? super V>> collectionFactory) -
naturalComparator
-
listSorter
-
boundedConsumer
-