com.sumologic.client.util.DeserializingResponseHandler Maven / Gradle / Ivy
package com.sumologic.client.util;
import org.apache.http.HttpResponse;
import java.io.IOException;
import java.io.InputStream;
public class DeserializingResponseHandler
implements ResponseHandler {
private Class clazz;
public DeserializingResponseHandler(Class clazz) {
this.clazz = clazz;
}
@Override
public Response handle(HttpResponse httpResponse, InputStream httpStream, Request request)
throws IOException {
return JacksonUtils.MAPPER.readValue(httpStream, clazz);
}
}