Class FluentHelperUpdate<FluentHelperT,EntityT extends VdmEntity<?>>

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperBasic<FluentHelperT,EntityT,ModificationResponse<EntityT>>
com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperModification<FluentHelperT,EntityT>
com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperUpdate<FluentHelperT,EntityT>
Type Parameters:
FluentHelperT - The fluent helper type.
EntityT - The type of the entity to update.
All Implemented Interfaces:
FluentHelperExecutable<Object>

public abstract class FluentHelperUpdate<FluentHelperT,EntityT extends VdmEntity<?>> extends FluentHelperModification<FluentHelperT,EntityT>
Representation of an OData update request as a fluent interface for further configuring the request and executing it.
  • Constructor Details

    • FluentHelperUpdate

      public FluentHelperUpdate(@Nonnull String servicePath, @Nonnull String entityCollection)
      Instantiates this fluent helper using the given service path to send the requests.
      Parameters:
      servicePath - The service path to direct the requests to.
      entityCollection - The entity collection to direct the requests to.
  • Method Details

    • getEntity

      protected abstract EntityT getEntity()
      The entity object to be updated by calling the executeRequest(Destination) method.
      Returns:
      The entity to be updated.
    • getEntityClass

      @Nonnull protected Class<? extends EntityT> getEntityClass()
      Description copied from class: FluentHelperBasic
      Returns a class object of the type this fluent helper works with.
      Specified by:
      getEntityClass in class FluentHelperBasic<FluentHelperT,EntityT extends VdmEntity<?>,ModificationResponse<EntityT extends VdmEntity<?>>>
      Returns:
      A class object of the handled type.
    • disableVersionIdentifier

      @Nonnull public FluentHelperT disableVersionIdentifier()
      The update request will ignore any version identifier present on the entity and not send an `If-Match` header.

      Warning: This might lead to a response from the remote system that the `If-Match` header is missing.

      It depends on the implementation of the remote system whether the `If-Match` header is expected.

      Returns:
      The same request builder that will not send the `If-Match` header in the update request
    • matchAnyVersionIdentifier

      @Nonnull public FluentHelperT matchAnyVersionIdentifier()
      The update request will ignore any version identifier present on the entity and update the entity, regardless of any changes on the remote entity.

      Warning: Be careful with this option, as this might overwrite any changes made to the remote representation of this object.

      Returns:
      The same request builder that will ignore the version identifier of the entity to update
    • executeRequest

      @Nonnull public ModificationResponse<EntityT> executeRequest(@Nonnull Destination destination)
      Description copied from interface: FluentHelperExecutable
      Executes this request.
      Specified by:
      executeRequest in interface FluentHelperExecutable<FluentHelperT>
      Specified by:
      executeRequest in class FluentHelperBasic<FluentHelperT,EntityT extends VdmEntity<?>,ModificationResponse<EntityT extends VdmEntity<?>>>
      Parameters:
      destination - The target system this request should be issued against.
      Returns:
      A response according to the query criteria.
    • toRequest

      @Nonnull public ODataRequestUpdate toRequest()
      Description copied from class: FluentHelperBasic
      Translate this OData v2 request into a OData request object extending ODataRequestGeneric.
      Specified by:
      toRequest in class FluentHelperBasic<FluentHelperT,EntityT extends VdmEntity<?>,ModificationResponse<EntityT extends VdmEntity<?>>>
      Returns:
      A protocol agnostic OData request instance.
    • includingFields

      @Nonnull @SafeVarargs public final FluentHelperT includingFields(@Nonnull EntitySelectable<EntityT>... fields)
      Allows to explicitly specify entity fields that shall be sent in an update request regardless if the values of these fields have been changed. This is helpful in case the API requires to send certain fields in any case in an update request.
      Parameters:
      fields - The fields to be included in the update execution.
      Returns:
      The same fluent helper which will include the specified fields in an update request.
    • excludingFields

      @Nonnull @SafeVarargs public final FluentHelperT excludingFields(@Nonnull EntitySelectable<EntityT>... fields)
      Allows to explicitly specify entity fields that should not be sent in an update request. This is helpful in case, some services require no read only fields to be sent for update requests. These fields are only excluded in a PUT request, they are not considered in a PATCH request.
      Parameters:
      fields - The fields to be excluded in the update execution.
      Returns:
      The same fluent helper which will exclude the specified fields in an update request.
    • replacingEntity

      @Nonnull public final FluentHelperT replacingEntity()
      Allows to control that the request to update the entity is sent with the HTTP method PUT and its payload contains all fields of the entity, regardless which of them have been changed.
      Returns:
      The same fluent helper which will replace the entity in the remote system
    • modifyingEntity

      @Nonnull public final FluentHelperT modifyingEntity()
      Allows to control that the request to update the entity is sent with the HTTP method PATCH and its payload contains the changed fields only.
      Returns:
      The same fluent helper which will modify the entity in the remote system.