Class ApiFutureUtils
java.lang.Object
com.google.adk.utils.ApiFutureUtils
Utility class for converting ApiFuture to RxJava Single and Maybe types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> io.reactivex.rxjava3.core.Maybe<T> toMaybe(com.google.api.core.ApiFuture<T> future) Converts an ApiFuture to an RxJava Maybe.static <T> io.reactivex.rxjava3.core.Single<T> toSingle(com.google.api.core.ApiFuture<T> future) Converts an ApiFuture to an RxJava Single.
-
Method Details
-
toSingle
public static <T> io.reactivex.rxjava3.core.Single<T> toSingle(com.google.api.core.ApiFuture<T> future) Converts an ApiFuture to an RxJava Single.- Type Parameters:
T- the type of the result- Parameters:
future- the ApiFuture to convert- Returns:
- a Single that emits the result of the ApiFuture
-
toMaybe
public static <T> io.reactivex.rxjava3.core.Maybe<T> toMaybe(com.google.api.core.ApiFuture<T> future) Converts an ApiFuture to an RxJava Maybe.- Type Parameters:
T- the type of the result- Parameters:
future- the ApiFuture to convert- Returns:
- a Maybe that emits the result of the ApiFuture or completes if the future fails
-