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
Modifier and TypeMethodDescriptionstatic <T> DefaultingJsonResponseHandler
<T> createDefaultingJsonResponseHandler
(JsonCodec<T> jsonCodec, T defaultValue) static <T> DefaultingJsonResponseHandler
<T> createDefaultingJsonResponseHandler
(JsonCodec<T> jsonCodec, T defaultValue, int firstSuccessfulResponseCode, int... otherSuccessfulResponseCodes) handleException
(Request request, Exception exception)
-
Method Details
-
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
- Specified by:
handleException
in interfaceResponseHandler<T,
RuntimeException>
-
handle
- Specified by:
handle
in interfaceResponseHandler<T,
RuntimeException>
-