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 Summary
ConstructorsConstructorDescriptionBatchChangeSetFluentHelperBasic(FluentHelperBatchT typedBatchFluentHelper, BatchFluentHelperBasic<?, ?> basicBatchFluentHelper) -
Method Summary
Modifier and TypeMethodDescriptionaddFunctionImport(FluentHelperFunction<?, ?, ?> functionImport) Adds a function import call to the currently opened changeset.protected ThisTaddRequest(FluentHelperCreate<?, ?> createRequest) Adds a create operation to the current changeset request.protected ThisTaddRequest(FluentHelperDelete<?, ?> deleteRequest) Adds a delete operation to the current changeset request.protected ThisTaddRequest(FluentHelperUpdate<?, ?> updateRequest) Adds an update operation to the current changeset request.addRequestCreate(Function<EntityT, FluentHelperCreate<?, EntityT>> serviceMethod, EntityT entity) Add a create operation to the current changeset request.addRequestDelete(Function<EntityT, FluentHelperDelete<?, EntityT>> serviceMethod, EntityT entity) Add a delete operation to the current changeset request.addRequestUpdate(Function<EntityT, FluentHelperUpdate<?, EntityT>> serviceMethod, EntityT entity) Add an update operation to the current changeset request.Finish the definition of a single changeset and return to the parent OData batch request instance.protected abstract ThisTgetThis()Method to safely return the current fluent helper instance upon public method calls.
-
Constructor Details
-
BatchChangeSetFluentHelperBasic
public BatchChangeSetFluentHelperBasic(FluentHelperBatchT typedBatchFluentHelper, BatchFluentHelperBasic<?, ?> basicBatchFluentHelper)
-
-
Method Details
-
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
Adds a delete operation to the current changeset request.- Parameters:
deleteRequest- TheFluentHelperDeletethat 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
Adds a create operation to the current changeset request.- Parameters:
createRequest- TheFluentHelperCreatethat 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
Adds an update operation to the current changeset request.- Parameters:
updateRequest- TheFluentHelperUpdatethat represents the update operation.- Returns:
- The current fluent helper instance.
-
endChangeSet
Description copied from interface:FluentHelperBatchEndChangeSetFinish 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:
endChangeSetin interfaceFluentHelperBatchEndChangeSet<FluentHelperBatchT extends FluentHelperServiceBatch<?,?>> - Returns:
- The current OData batch request instance.
-
addFunctionImport
Adds a function import call to the currently opened changeset. Only useexecuteRequestto issue the batch request.- Parameters:
functionImport- TheFluentHelperFunctionthat 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.
-