ServiceResponse<T> 類別

  • java.lang.Object
    • com.microsoft.bot.restclient.ServiceResponse<T>

類型參數

T

回應的類型

public class ServiceResponse

這個類別的實例會保存回應物件和原始 REST 回應。

建構函式摘要

建構函式 Description
ServiceResponse(T body, Response<ResponseBody> response)

使用回應物件和原始 REST 回應,具現化服務回應實例。

ServiceResponse(Response<Void> headResponse)

使用 HEAD 作業的回應具現化服務回應實例。

方法摘要

修飾詞與類型 方法與描述
T body()

取得回應物件。

retrofit2.Response<java.lang.Void> headResponse()

從 HEAD 作業取得原始 REST 回應。

retrofit2.Response<okhttp3.ResponseBody> response()

取得原始 REST 回應。

ServiceResponse<T> withBody(T body)

設定回應物件。

方法繼承來源 java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

建構函式詳細資料

ServiceResponse

public ServiceResponse(T body, Response response)

使用回應物件和原始 REST 回應具現化 ServiceResponse 實例。

參數:

body - 還原串行化回應物件
response - 原始 REST 回應

ServiceResponse

public ServiceResponse(Response headResponse)

使用 HEAD 作業的回應具現化 ServiceResponse 實例。

參數:

headResponse - 來自 HEAD 作業的原始 REST 回應

方法詳細資料

body

public T body()

取得回應物件。

傳回:

回應物件。 如果沒有 Null,則為 Null。

headResponse

public Response headResponse()

從 HEAD 作業取得原始 REST 回應。

傳回:

來自 HEAD 作業的原始 REST 回應。

response

public Response response()

取得原始 REST 回應。

傳回:

原始 REST 回應。

withBody

public ServiceResponse withBody(T body)

設定回應物件。

參數:

body - 回應物件。

傳回:

ServiceResponse 物件本身

適用於