@Beta public class ODataRequestResultGeneric extends Object implements ODataRequestResult, ODataRequestResultDeserializable, ODataRequestResultPagination
| Constructor and Description |
|---|
ODataRequestResultGeneric(ODataRequestGeneric oDataRequest,
org.apache.http.HttpResponse httpResponse)
Default constructor.
|
ODataRequestResultGeneric(ODataRequestGeneric oDataRequest,
org.apache.http.HttpResponse httpResponse,
org.apache.http.client.HttpClient httpClient)
Default constructor with enabled pagination.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
as(Class<T> objectType)
Converts ODataRequestResult into POJO.
|
<T> T |
as(Class<T> objectType,
Function<com.google.gson.JsonElement,com.google.gson.JsonElement> resultExtractor)
Converts ODataRequestResult into a POJO based on a function extracting the relevant JSON response object.
|
<T> List<T> |
asList(Class<T> objectType)
Converts ODataRequestResult into list of POJOs.
|
List<Map<String,Object>> |
asListOfMaps()
Construct and get a list of key-value maps from the OData response.
|
Map<String,Object> |
asMap()
Construct and get a key-value map from the OData response.
|
protected boolean |
canEqual(Object other) |
void |
disableBufferingHttpResponse()
Method that allows consumers to disable buffering HTTP response entity.
|
boolean |
equals(Object o) |
io.vavr.control.Option<String> |
getDeltaLink()
Get the delta link of the current result-set.
|
org.apache.http.HttpResponse |
getHttpResponse()
Method that creates a
BufferedHttpEntity from the HttpEntity if buffering the HTTP response is
not turned off by using disableBufferingHttpResponse(). |
long |
getInlineCount()
Get the count of elements in the result set.
|
io.vavr.control.Option<String> |
getNextLink()
Get the next page link of result-set.
|
ODataRequestGeneric |
getODataRequest()
Get the original
ODataRequestExecutable instance that was used for running the OData request. |
io.vavr.control.Option<String> |
getVersionIdentifierFromHeader()
Try to extract a version identifier from the ETag header.
|
int |
hashCode() |
boolean |
hasPayload()
Check whether or not the HttpResponse contains (potentially empty) payload.
|
Iterator<ResultElement> |
iterator() |
void |
streamElements(Consumer<ResultElement> handler)
Run a consumer for fluent API type ResultElement to iterate over the OData response with a continuous data
stream.
|
io.vavr.control.Try<ODataRequestResultGeneric> |
tryGetNextPage()
Get the next page link of result-set.
|
ODataRequestResultGeneric |
withNumberDeserializationStrategy(NumberDeserializationStrategy numberStrategy)
Set the default number deserialization strategy for generic JSON numbers without target type mapping.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetAllHeaderValues, getHeaderNames, getHeaderValuesiteratePagesforEach, spliteratorpublic ODataRequestResultGeneric(@Nonnull ODataRequestGeneric oDataRequest, @Nonnull org.apache.http.HttpResponse httpResponse)
oDataRequest - The original OData requesthttpResponse - The original Http responsepublic ODataRequestResultGeneric(@Nonnull ODataRequestGeneric oDataRequest, @Nonnull org.apache.http.HttpResponse httpResponse, @Nullable org.apache.http.client.HttpClient httpClient)
oDataRequest - The original OData requesthttpResponse - The original Http responsehttpClient - The original Http client@Nonnull public ODataRequestResultGeneric withNumberDeserializationStrategy(@Nonnull NumberDeserializationStrategy numberStrategy)
numberStrategy - The number deserialization strategy to use.ODataRequestGeneric.public void disableBufferingHttpResponse()
@Nonnull public org.apache.http.HttpResponse getHttpResponse()
BufferedHttpEntity from the HttpEntity if buffering the HTTP response is
not turned off by using disableBufferingHttpResponse().getHttpResponse in interface ODataRequestResultpublic void streamElements(@Nonnull Consumer<ResultElement> handler)
ODataRequestResultDeserializablestreamElements in interface ODataRequestResultDeserializablehandler - The consumer for generic ResultElement.@Nonnull public io.vavr.control.Option<String> getVersionIdentifierFromHeader()
Option.None, if none was found.@Nonnull public Iterator<ResultElement> iterator()
iterator in interface Iterable<ResultElement>@Nonnull public <T> T as(@Nonnull Class<T> objectType)
ODataRequestResultDeserializableas in interface ODataRequestResultDeserializableT - The generic type of POJOobjectType - type of POJO@Nonnull public <T> T as(@Nonnull Class<T> objectType, @Nonnull Function<com.google.gson.JsonElement,com.google.gson.JsonElement> resultExtractor)
T - The generic type of POJOobjectType - type of POJOresultExtractor - A function extracting the relevant result object of the JSON root object. In case of OData V2 the
"d" object is treated as the root object. Pass Function.identity() in case no
transformation should take place.ODataResponseException - When the HTTP status indicates an erroneous response.ODataDeserializationException - When deserialization process failed for the OData response object.@Nonnull public <T> List<T> asList(@Nonnull Class<T> objectType)
ODataRequestResultDeserializableasList in interface ODataRequestResultDeserializableT - Generic type of the POJOobjectType - type of POJOpublic long getInlineCount()
ODataRequestResultDeserializablegetInlineCount in interface ODataRequestResultDeserializable@Nonnull public io.vavr.control.Option<String> getNextLink()
ODataRequestResultPaginationgetNextLink in interface ODataRequestResultPaginationnull if last page of result-set.@Nonnull public io.vavr.control.Option<String> getDeltaLink()
@Nonnull public Map<String,Object> asMap()
ODataRequestResultDeserializableasMap in interface ODataRequestResultDeserializable@Nonnull public List<Map<String,Object>> asListOfMaps()
ODataRequestResultDeserializableasListOfMaps in interface ODataRequestResultDeserializable@Nonnull public io.vavr.control.Try<ODataRequestResultGeneric> tryGetNextPage()
ODataRequestResultPaginationtryGetNextPage in interface ODataRequestResultPaginationnull if last page of result-set.public boolean hasPayload()
HttpEntity.@Nonnull public ODataRequestGeneric getODataRequest()
ODataRequestResultODataRequestExecutable instance that was used for running the OData request.getODataRequest in interface ODataRequestResultgetODataRequest in interface ODataRequestResultPaginationODataRequestExecutable instance.Copyright © 2022 SAP SE. All rights reserved.