类:ApiFutureUtils

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

public class ApiFutureUtils extends Object
这是一个实用类,用于将 `ApiFuture` 对象转换为 RxJava 的 `Single` 或 `Maybe` 类型。
  • 方法概述

    Modifier and Type
    Method
    Description
    static <T> io.reactivex.rxjava3.core.Maybe<T>
    toMaybe(com.google.api.core.ApiFuture<T> future)
    将 `ApiFuture` 对象转换为 `RxJava Maybe` 对象。
    static <T> io.reactivex.rxjava3.core.Single<T>
    toSingle(com.google.api.core.ApiFuture<T> future)
    将 `ApiFuture` 对象转换为 `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)
      将 `ApiFuture` 对象转换为 `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)
      将 `ApiFuture` 对象转换为 `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