Class BatchChangeSetFluentHelperBasic<FluentHelperBatchT extends FluentHelperServiceBatch<?,?>,ThisT>

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.batch.BatchChangeSetFluentHelperBasic<FluentHelperBatchT,ThisT>
Type Parameters:
FluentHelperBatchT - The fluent helper type of the associated OData batch request.
ThisT - The current type of the implementing fluent helper instance.
All Implemented Interfaces:
FluentHelperBatchEndChangeSet<FluentHelperBatchT>

public abstract class BatchChangeSetFluentHelperBasic<FluentHelperBatchT extends FluentHelperServiceBatch<?,?>,ThisT> extends Object implements FluentHelperBatchEndChangeSet<FluentHelperBatchT>
Representation of any changeset in a OData batch request as a fluent interface.
  • Constructor Details

  • Method Details

    • getThis

      @Nonnull protected abstract ThisT getThis()
      Method to safely return the current fluent helper instance upon public method calls.
      Returns:
      The current fluent helper instance.
    • addRequestDelete

      @Nonnull protected <EntityT extends VdmEntity<EntityT>> ThisT addRequestDelete(Function<EntityT,FluentHelperDelete<?,EntityT>> serviceMethod, EntityT entity)
      Add a delete operation to the current changeset request.
      Type Parameters:
      EntityT - The entity type to guarantee type safety.
      Parameters:
      serviceMethod - The method of a delete fluent helper from the given service class.
      entity - The entity instance to be deleted.
      Returns:
      The current fluent helper instance.
    • addRequest

      @Nonnull protected ThisT addRequest(@Nonnull FluentHelperDelete<?,?> deleteRequest)
      Adds a delete operation to the current changeset request.
      Parameters:
      deleteRequest - The FluentHelperDelete that represents the delete operation.
      Returns:
      The current fluent helper instance.
    • addRequestCreate

      @Nonnull protected <EntityT extends VdmEntity<EntityT>> ThisT addRequestCreate(Function<EntityT,FluentHelperCreate<?,EntityT>> serviceMethod, EntityT entity)
      Add a create operation to the current changeset request.
      Type Parameters:
      EntityT - The entity type to guarantee type safety.
      Parameters:
      serviceMethod - The method of a create fluent helper from the given service class.
      entity - The entity instance to be created.
      Returns:
      The current fluent helper instance.
    • addRequest

      @Nonnull protected ThisT addRequest(@Nonnull FluentHelperCreate<?,?> createRequest)
      Adds a create operation to the current changeset request.
      Parameters:
      createRequest - The FluentHelperCreate that represents the create operation.
      Returns:
      The current fluent helper instance.
    • addRequestUpdate

      @Nonnull protected <EntityT extends VdmEntity<EntityT>> ThisT addRequestUpdate(Function<EntityT,FluentHelperUpdate<?,EntityT>> serviceMethod, EntityT entity)
      Add an update operation to the current changeset request.
      Type Parameters:
      EntityT - The entity type to guarantee type safety.
      Parameters:
      serviceMethod - The method of an update fluent helper from the given service class.
      entity - The entity instance to be updated.
      Returns:
      The current fluent helper instance.
    • addRequest

      @Nonnull protected ThisT addRequest(@Nonnull FluentHelperUpdate<?,?> updateRequest)
      Adds an update operation to the current changeset request.
      Parameters:
      updateRequest - The FluentHelperUpdate that represents the update operation.
      Returns:
      The current fluent helper instance.
    • endChangeSet

      @Nonnull public FluentHelperBatchT endChangeSet()
      Description copied from interface: FluentHelperBatchEndChangeSet
      Finish the definition of a single changeset and return to the parent OData batch request instance. All changesets will be evaluated independently from each other.
      Specified by:
      endChangeSet in interface FluentHelperBatchEndChangeSet<FluentHelperBatchT extends FluentHelperServiceBatch<?,?>>
      Returns:
      The current OData batch request instance.
    • addFunctionImport

      @Nonnull public ThisT addFunctionImport(@Nonnull FluentHelperFunction<?,?,?> functionImport)
      Adds a function import call to the currently opened changeset. Only use executeRequest to issue the batch request.
      Parameters:
      functionImport - The FluentHelperFunction that represents the function import call
      Returns:
      The same fluent helper
      Throws:
      IllegalStateException - If the batch request contains a function import call within a change set which uses the HTTP GET method.