Class DefaultBatchResponseResult

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.batch.DefaultBatchResponseResult
All Implemented Interfaces:
BatchResponse, AutoCloseable

public class DefaultBatchResponseResult extends Object implements BatchResponse
Generic OData service response wrapper for Batch response.
  • Method Details

    • of

      @Nonnull public static DefaultBatchResponseResult of(@Nonnull ODataRequestResultMultipartGeneric response, @Nonnull BatchFluentHelperBasic<?,?> initialRequest)
      Static factory method to convert from generic response to typed response.
      Parameters:
      response - The generic response that should be converted.
      initialRequest - The initial BatchRequest
      Returns:
      The typed (high-level) BatchResponse object.
    • get

      @Nonnull public io.vavr.control.Try<BatchResponseChangeSet> get(int index)
      Description copied from interface: BatchResponse
      Get the result for a single changeset.
      Specified by:
      get in interface BatchResponse
      Parameters:
      index - The zero-based index of the selected changeset.
      Returns:
      A wrapper of the changeset result. It can be checked for errors upon evaluation.
    • getReadResult

      @Nonnull public <EntityT extends VdmEntity<?>> List<EntityT> getReadResult(@Nonnull FluentHelperRead<?,EntityT,?> helper)
      Description copied from interface: BatchResponse
      Convenience method to get the result for a read request on the OData batch response.
      Specified by:
      getReadResult in interface BatchResponse
      Type Parameters:
      EntityT - The generic entity type.
      Parameters:
      helper - The original fluent helper instance that was used to create the request.
      Returns:
      A list of entities according to the original request.
    • getReadResult

      @Nonnull public <EntityT extends VdmEntity<?>> EntityT getReadResult(@Nonnull FluentHelperByKey<?,EntityT,?> helper)
      Description copied from interface: BatchResponse
      Convenience method to get the result for a read-by-key request on the OData batch response.
      Specified by:
      getReadResult in interface BatchResponse
      Type Parameters:
      EntityT - The generic entity type.
      Parameters:
      helper - The original fluent helper instance that was used to create the request.
      Returns:
      A single entity according to the original request.
    • getReadResult

      @Nonnull public <ResultT> ResultT getReadResult(@Nonnull SingleValuedFluentHelperFunction<?,ResultT,?> helper)
      Description copied from interface: BatchResponse
      Convenience method to get the result for a function import request that returns a single primitive value or entity on the OData batch response.
      Specified by:
      getReadResult in interface BatchResponse
      Type Parameters:
      ResultT - The result type of the function import request
      Parameters:
      helper - The original fluent helper instance that was used to create the request.
      Returns:
      A single primitive value or entity according to the original request
    • getReadResult

      @Nonnull public <ResultT> List<ResultT> getReadResult(@Nonnull CollectionValuedFluentHelperFunction<?,ResultT,?> helper)
      Description copied from interface: BatchResponse
      Convenience method to get the result for a function import request that returns a collection of primitive values or entities on the OData batch response.
      Specified by:
      getReadResult in interface BatchResponse
      Type Parameters:
      ResultT - The result type of the function import request
      Parameters:
      helper - The original fluent helper instance that was used to create the request.
      Returns:
      A collection of primitive values or entities according to the original request
    • close

      @Beta public void close()
      Closes the underlying HTTP response entity.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface BatchResponse
      Since:
      4.15.0