Class ODataRequestReadByKey
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestReadByKey
- All Implemented Interfaces:
ODataRequestExecutable
The result type of the OData read by key request.
-
Field Summary
Fields inherited from class com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
csrfTokenRetriever, resourcePath, servicePath
-
Constructor Summary
ConstructorDescriptionODataRequestReadByKey
(String servicePath, ODataResourcePath entityPath, ODataEntityKey entityKey, StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly.ODataRequestReadByKey
(String servicePath, ODataResourcePath entityPath, String encodedQuery, ODataProtocol protocol) Default constructor for OData Read requests.ODataRequestReadByKey
(String servicePath, String entityName, ODataEntityKey entityKey, 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
-
ODataRequestReadByKey
public ODataRequestReadByKey(@Nonnull String servicePath, @Nonnull String entityName, @Nonnull ODataEntityKey entityKey, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Convenience constructor for OData read requests on entity collections directly. For operations on nested entities useODataRequestReadByKey(String, ODataResourcePath, String, ODataProtocol)
.- Parameters:
servicePath
- The OData service path.entityName
- The OData entity name.entityKey
- The entity key.encodedQuery
- Optional: The encoded HTTP query, if any.protocol
- The OData protocol to use.
-
ODataRequestReadByKey
public ODataRequestReadByKey(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nullable String encodedQuery, @Nonnull ODataProtocol protocol) Default constructor for OData Read requests.- Parameters:
servicePath
- The OData service path.entityPath
- TheODataResourcePath
that identifies the entity to read.encodedQuery
- Optional: The encoded HTTP query, if any.protocol
- The OData protocol to use.
-
ODataRequestReadByKey
public ODataRequestReadByKey(@Nonnull String servicePath, @Nonnull ODataResourcePath entityPath, @Nonnull ODataEntityKey entityKey, @Nonnull StructuredQuery query) Constructor with StructuredQuery for OData read requests on entity collections directly. For operations on nested entity collections use#ODataRequestRead(String, ODataResourcePath, String, ODataProtocol)
.- Parameters:
servicePath
- The OData service path.entityPath
- TheODataResourcePath
that identifies the collection of entities or properties to read.entityKey
- The entity key.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
-