Package kong.unirest.core
Class ObjectResponse<T>
- java.lang.Object
-
- kong.unirest.core.BaseResponse<T>
-
- kong.unirest.core.ObjectResponse<T>
-
- All Implemented Interfaces:
HttpResponse<T>
class ObjectResponse<T> extends BaseResponse<T>
-
-
Field Summary
Fields Modifier and Type Field Description private Tbodyprivate ObjectMapperomprivate java.lang.StringrawBody
-
Constructor Summary
Constructors Constructor Description ObjectResponse(ObjectMapper om, RawResponse response, java.lang.Class<? extends T> to)ObjectResponse(ObjectMapper om, RawResponse response, GenericType<? extends T> to)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetBody()private TgetBody(java.lang.String b, java.util.function.Function<java.lang.String,T> func)protected java.lang.StringgetRawBody()private java.util.Optional<java.lang.String>readBody(RawResponse response)-
Methods inherited from class kong.unirest.core.BaseResponse
getCookies, getHeaders, getParsingError, getRequestSummary, getStatus, getStatusText, ifFailure, ifFailure, ifSuccess, isSuccess, map, mapBody, mapError, setParsingException
-
-
-
-
Field Detail
-
body
private final T body
-
om
private final ObjectMapper om
-
rawBody
private java.lang.String rawBody
-
-
Constructor Detail
-
ObjectResponse
ObjectResponse(ObjectMapper om, RawResponse response, java.lang.Class<? extends T> to)
-
ObjectResponse
ObjectResponse(ObjectMapper om, RawResponse response, GenericType<? extends T> to)
-
-
Method Detail
-
readBody
private java.util.Optional<java.lang.String> readBody(RawResponse response)
-
getBody
private T getBody(java.lang.String b, java.util.function.Function<java.lang.String,T> func)
-
getBody
public T getBody()
- Specified by:
getBodyin interfaceHttpResponse<T>- Specified by:
getBodyin classBaseResponse<T>- Returns:
- the body
-
getRawBody
protected java.lang.String getRawBody()
- Specified by:
getRawBodyin classBaseResponse<T>
-
-