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 T
body
private ObjectMapper
om
private java.lang.String
rawBody
-
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 T
getBody()
private T
getBody(java.lang.String b, java.util.function.Function<java.lang.String,T> func)
protected java.lang.String
getRawBody()
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:
getBody
in interfaceHttpResponse<T>
- Specified by:
getBody
in classBaseResponse<T>
- Returns:
- the body
-
getRawBody
protected java.lang.String getRawBody()
- Specified by:
getRawBody
in classBaseResponse<T>
-
-