Class ApiFutureUtils

java.lang.Object
com.google.adk.utils.ApiFutureUtils

public class ApiFutureUtils extends Object
Utility class for converting ApiFuture to RxJava Single and Maybe types.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <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.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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