Class ODataRequestRead
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestRead
- All Implemented Interfaces:
ODataRequestExecutable
- Direct Known Subclasses:
ODataRequestCount
The result type of the OData Read request.
-
Field Summary
Fields inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
csrfTokenRetriever, resourcePath, servicePath
-
Constructor Summary
ConstructorDescriptionODataRequestRead
(String servicePath, ODataResourcePath entityPath, StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly.ODataRequestRead
(String servicePath, ODataResourcePath entityPath, String encodedQuery, ODataProtocol protocol) Default constructor for OData Read request.ODataRequestRead
(String servicePath, String entityName, String encodedQuery, ODataProtocol protocol) Convenience constructor for OData read requests on entity collections directly. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
execute
(org.apache.http.client.HttpClient httpClient) Execute the OData request with the provided HttpClient reference.getRelativeUri
(UriEncodingStrategy strategy) Get the static request URI of the OData resource.Use all OData query information to construct a HTTP request query String.int
hashCode()
Methods inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
addHeader, addHeaderIfAbsent, addListener, addQueryParameter, getHeaders, getListeners, getProtocol, getQueryParameters, getRelativeUri, getResourcePath, getServicePath, setCsrfTokenRetriever, setHeader, setHeader, tryExecute, tryExecuteWithCsrfToken
-
Constructor Details
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull String entityName, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Convenience constructor for OData read requests on entity collections directly. For operations on nested entity collections useODataRequestRead(String, ODataResourcePath, String, ODataProtocol)
.- Parameters:
servicePath
- The OData service path.entityName
- The OData entity name.encodedQuery
- Optional: The encoded HTTP query, if any.protocol
- The OData protocol to use.
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Default constructor for OData Read request.Note: The query string
queryString
must not contain characters that are forbidden in URLs, like spaces. If forbidden characters are present, anIllegalArgumentException
is thrown.Build an instance of
StructuredQuery
and pass the value ofStructuredQuery.getEncodedQueryString()
asqueryString
to this method.Alternatively, use
UrlEscapers.urlFragmentEscaper()
from the Guava library to escape the query string before passing it here.- Parameters:
servicePath
- The OData service path.entityPath
- TheODataResourcePath
that identifies the collection of entities or properties to read.encodedQuery
- Optional: The encoded HTTP query, if any.protocol
- The OData protocol to use.
-
ODataRequestRead
public ODataRequestRead(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nonnull StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly. For operations on nested entity collections useODataRequestRead(String, ODataResourcePath, String, ODataProtocol)
.- Parameters:
servicePath
- The OData service path.entityPath
- TheODataResourcePath
that identifies the collection of entities or properties to read.query
- The structured query.
-
-
Method Details
-
getRelativeUri
Description copied from class:ODataRequestGeneric
Get the static request URI of the OData resource.- Specified by:
getRelativeUri
in classODataRequestGeneric
- Parameters:
strategy
- URI encoding strategy.- Returns:
- The String representation of the request URI.
-
getRequestQuery
Description copied from class:ODataRequestGeneric
Use all OData query information to construct a HTTP request query String.- Overrides:
getRequestQuery
in classODataRequestGeneric
- Returns:
- The request query.
-
execute
@Nonnull public ODataRequestResultGeneric execute(@Nonnull org.apache.http.client.HttpClient httpClient) Description copied from interface:ODataRequestExecutable
Execute the OData request with the provided HttpClient reference.- Parameters:
httpClient
- The HttpClient.- Returns:
- An OData request result.
-
getQueryString
-
equals
- Overrides:
equals
in classODataRequestGeneric
-
canEqual
- Overrides:
canEqual
in classODataRequestGeneric
-
hashCode
public int hashCode()- Overrides:
hashCode
in classODataRequestGeneric
-