co.cask.common.http
Class ObjectResponse<T>
java.lang.Object
co.cask.common.http.HttpResponse
co.cask.common.http.ObjectResponse<T>
- Type Parameters:
T - type of the response object
public final class ObjectResponse<T>
- extends HttpResponse
Convenient wrapper of HttpResponse that makes client code cleaner when dealing with java object that can be
de-serialized from response body.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
Type typeOfObject,
com.google.gson.Gson gson)
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
Type typeOfObject)
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
com.google.common.reflect.TypeToken<T> typeOfObject,
com.google.gson.Gson gson)
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
com.google.common.reflect.TypeToken<T> typeOfObject)
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
Class<T> typeOfObject,
com.google.gson.Gson gson)
fromJsonBody
public static <T> ObjectResponse<T> fromJsonBody(HttpResponse response,
Class<T> typeOfObject)
getResponseObject
public T getResponseObject()
Copyright © 2014 Cask Data, Inc. Licensed under the Apache License, Version 2.0.