com.turbomanage.httpclient.rest.ObjectResponse Maven / Gradle / Ivy
package com.turbomanage.httpclient.rest;
import com.turbomanage.httpclient.HttpResponse;
public abstract class ObjectResponse {
protected HttpResponse httpResponse;
protected ObjectFactory objFactory;
public ObjectResponse(HttpResponse res, ObjectFactory factory) {
this.httpResponse = res;
this.objFactory = factory;
}
public T toObj(Class responseType) {
return (T) objFactory.toObj(httpResponse.getBody(), responseType);
}
public HttpResponse getHttpResponse() {
return httpResponse;
}
}