Class ODataRequestBatch

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestGeneric
com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestBatch
All Implemented Interfaces:
ODataRequestExecutable

public class ODataRequestBatch extends ODataRequestGeneric
The OData Batch request.
  • Constructor Details

    • ODataRequestBatch

      public ODataRequestBatch(@Nonnull String servicePath, @Nonnull ODataProtocol protocol)
      Default constructor for OData Batch request. The service path will be URL-encoded during request serialization.
      Parameters:
      servicePath - The unencoded OData service path
      protocol - The OData protocol
    • ODataRequestBatch

      public ODataRequestBatch(@Nonnull String servicePath, @Nonnull ODataProtocol protocol, @Nonnull Supplier<UUID> uuidProvider)
      Default constructor for OData Batch request. The service path will be URL-encoded during request serialization.
      Parameters:
      servicePath - The unencoded OData service path
      protocol - The OData protocol
      uuidProvider - A generic UUID provider, customizable for testing
  • Method Details

    • getRelativeUri

      @Nonnull public URI getRelativeUri(@Nonnull UriEncodingStrategy strategy)
      Description copied from class: ODataRequestGeneric
      Get the static request URI of the OData resource.
      Specified by:
      getRelativeUri in class ODataRequestGeneric
      Parameters:
      strategy - URI encoding strategy.
      Returns:
      The String representation of the request URI.
    • addRead

      @Nonnull public ODataRequestBatch addRead(@Nonnull ODataRequestRead request)
      Add an OData Read request to the current OData Batch request.
      Parameters:
      request - The Read request.
      Returns:
      The Batch request fluent helper instance.
    • addReadByKey

      @Nonnull public ODataRequestBatch addReadByKey(@Nonnull ODataRequestReadByKey request)
      Add an OData Read-By-Key request to the current OData Batch request.
      Parameters:
      request - The Read-By-Key request.
      Returns:
      The Batch request fluent helper instance.
    • addFunction

      @Nonnull public ODataRequestBatch addFunction(@Nonnull ODataRequestFunction request)
      Add an OData Function request to the current OData Batch request.
      Parameters:
      request - The Function request.
      Returns:
      The Batch request fluent helper instance.
    • beginChangeset

      @Nonnull public ODataRequestBatch.Changeset beginChangeset()
      Instantiate a new changeset to the current OData Batch request. As per specification if any data modifying operation fails within one changeset, then the incomplete changes will be reverted.
      Returns:
      A new Changeset fluent helper instance.
    • execute

      @Nonnull public ODataRequestResultMultipartGeneric 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.
    • getHeaders

      @Nonnull public Map<String,Collection<String>> getHeaders()
      Description copied from class: ODataRequestGeneric
      Get the list of headers that will be sent with this request. To add headers, please use addHeader and addHeaderIfAbsent
      Overrides:
      getHeaders in class ODataRequestGeneric
      Returns:
      The list of headers.
    • getRequests

      @Nonnull public List<com.sap.cloud.sdk.datamodel.odata.client.request.ODataRequestBatch.BatchItem> getRequests()
    • getContentId

      public AtomicInteger getContentId()
    • getBatchUuid

      public UUID getBatchUuid()
    • getUuidProvider

      public Supplier<UUID> getUuidProvider()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class ODataRequestGeneric
    • canEqual

      protected boolean canEqual(@Nullable Object other)
      Overrides:
      canEqual in class ODataRequestGeneric
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ODataRequestGeneric