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.-
Field Summary
Fields inherited from class com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperBasic
csrfTokenRetriever, entityCollection -
Constructor Summary
ConstructorsConstructorDescriptionFluentHelperUpdate(String servicePath, String entityCollection) Instantiates this fluent helper using the given service path to send the requests. -
Method Summary
Modifier and TypeMethodDescriptionThe update request will ignore any version identifier present on the entity and not send an `If-Match` header.final FluentHelperTexcludingFields(EntitySelectable<EntityT>... fields) Allows to explicitly specify entity fields that should not be sent in an update request.executeRequest(Destination destination) Executes this request.protected abstract EntityTThe entity object to be updated by calling theexecuteRequest(Destination)method.Returns a class object of the type this fluent helper works with.final FluentHelperTincludingFields(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.The update request will ignore any version identifier present on the entity and update the entity, regardless of any changes on the remote entity.final FluentHelperTAllows to control that the request to update the entity is sent with the HTTP method PATCH and its payload contains the changed fields only.final FluentHelperTmodifyingEntity(ModifyPatchStrategy strategy) 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, with different strategies for handling nested fields.final FluentHelperTAllows 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.Translate this OData v2 request into a OData request object extendingODataRequestGeneric.Methods inherited from class com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperModification
withoutCsrfTokenMethods inherited from class com.sap.cloud.sdk.datamodel.odata.helper.FluentHelperBasic
getCsrfTokenRetriever, getHeaders, getParametersForRequestOnly, getServicePath, getThis, withHeader, withHeaders, withQueryParameter
-
Constructor Details
-
FluentHelperUpdate
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
The entity object to be updated by calling theexecuteRequest(Destination)method.- Returns:
- The entity to be updated.
-
getEntityClass
Description copied from class:FluentHelperBasicReturns a class object of the type this fluent helper works with.- Specified by:
getEntityClassin classFluentHelperBasic<FluentHelperT,EntityT extends VdmEntity<?>, ModificationResponse<EntityT extends VdmEntity<?>>> - Returns:
- A class object of the handled type.
-
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
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
Description copied from interface:FluentHelperExecutableExecutes this request.- Specified by:
executeRequestin interfaceFluentHelperExecutable<FluentHelperT>- Specified by:
executeRequestin classFluentHelperBasic<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
Description copied from class:FluentHelperBasicTranslate this OData v2 request into a OData request object extendingODataRequestGeneric.- Specified by:
toRequestin classFluentHelperBasic<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
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
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.
-
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, with different strategies for handling nested fields.- Parameters:
strategy- The strategy to use for the PATCH update.- Returns:
- The same fluent helper which will modify the entity in the remote system.
- Throws:
IllegalArgumentException- If an unknown ModifyPatchStrategy is provided.- Since:
- 5.16.0
-