Package io.airlift.http.client
Class DefaultingJsonResponseHandler<T>
- java.lang.Object
-
- io.airlift.http.client.DefaultingJsonResponseHandler<T>
-
- All Implemented Interfaces:
ResponseHandler<T,RuntimeException>
public class DefaultingJsonResponseHandler<T> extends Object implements ResponseHandler<T,RuntimeException>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> DefaultingJsonResponseHandler<T>createDefaultingJsonResponseHandler(JsonCodec<T> jsonCodec, T defaultValue)static <T> DefaultingJsonResponseHandler<T>createDefaultingJsonResponseHandler(JsonCodec<T> jsonCodec, T defaultValue, int firstSuccessfulResponseCode, int... otherSuccessfulResponseCodes)Thandle(Request request, Response response)ThandleException(Request request, Exception exception)
-
-
-
Method Detail
-
createDefaultingJsonResponseHandler
public static <T> DefaultingJsonResponseHandler<T> createDefaultingJsonResponseHandler(JsonCodec<T> jsonCodec, T defaultValue)
-
createDefaultingJsonResponseHandler
public static <T> DefaultingJsonResponseHandler<T> createDefaultingJsonResponseHandler(JsonCodec<T> jsonCodec, T defaultValue, int firstSuccessfulResponseCode, int... otherSuccessfulResponseCodes)
-
handleException
public T handleException(Request request, Exception exception)
- Specified by:
handleExceptionin interfaceResponseHandler<T,RuntimeException>
-
handle
public T handle(Request request, Response response)
- Specified by:
handlein interfaceResponseHandler<T,RuntimeException>
-
-