Package org.infinispan.reactive
Class RxJavaInterop
- java.lang.Object
-
- org.infinispan.reactive.RxJavaInterop
-
public class RxJavaInterop extends java.lang.ObjectStatic factory class that provides methods to obtain commonly used instances for interoperation between RxJava and standard JRE.- Since:
- 10.0
- Author:
- wburns
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> java.util.function.Function<java.util.concurrent.CompletionStage<E>,io.reactivex.Flowable<E>>completionStageToPublisher()Provides an interop function that can be used to convert a CompletionStage into a Flowable.static <K,V>
io.reactivex.functions.Function<java.util.Map.Entry<K,V>,K>entryToKeyFunction()Provides aFunctionthat can be used to convert from an instance ofMap.Entryto the key of the entry.static <E> io.reactivex.functions.Function<io.reactivex.Maybe<E>,java.util.concurrent.CompletionStage<E>>maybeToCompletionStage()Provides an interop function that can be used to convert a Maybe into a CompletionStage.static <E> io.reactivex.functions.Function<io.reactivex.Single<E>,java.util.concurrent.CompletionStage<E>>singleToCompletionStage()Provides an interop function that can be used to convert a Single into a CompletionStage.
-
-
-
Method Detail
-
singleToCompletionStage
public static <E> io.reactivex.functions.Function<io.reactivex.Single<E>,java.util.concurrent.CompletionStage<E>> singleToCompletionStage()
Provides an interop function that can be used to convert a Single into a CompletionStage. Note that this function is not from the standard java.util.function package, but ratherFunctionto interop better with theSingle.to(Function)method.- Type Parameters:
E- underlying type- Returns:
- rxjava function to convert Single to CompletionStage
-
maybeToCompletionStage
public static <E> io.reactivex.functions.Function<io.reactivex.Maybe<E>,java.util.concurrent.CompletionStage<E>> maybeToCompletionStage()
Provides an interop function that can be used to convert a Maybe into a CompletionStage. Note that this function is not from the standard java.util.function package, but ratherFunctionto interop better with theMaybe.to(Function)method.- Type Parameters:
E- underlying type- Returns:
- rxjava function to convert Maybe to CompletionStage
-
completionStageToPublisher
public static <E> java.util.function.Function<java.util.concurrent.CompletionStage<E>,io.reactivex.Flowable<E>> completionStageToPublisher()
Provides an interop function that can be used to convert a CompletionStage into a Flowable. Note that this function is from the standard java.util.function package since we don't want the method to throw an exceptionRemember that the CompletionStage when completing normally MUST have a non null value!
- Type Parameters:
E- underlying type- Returns:
- java.util function to convert CompletionStage to Flowable
-
entryToKeyFunction
public static <K,V> io.reactivex.functions.Function<java.util.Map.Entry<K,V>,K> entryToKeyFunction()
Provides aFunctionthat can be used to convert from an instance ofMap.Entryto the key of the entry. This is useful for the instance passed to a method likeFlowable.map(Function).- Type Parameters:
K- key typeV- value type- Returns:
- rxjava function to convert from a Map.Entry to its key.
-
-