Interface SaveOperation
public interface SaveOperation
Operation to save a
store element
with defined options.
The common way to use this operation is to:
- lock the desired element;
- make changes to its data;
- save the element using this operation;
- unlock the element.
- Since:
- 5.2.1804
-
Field Summary
Modifier and TypeFieldDescriptionstatic final OperationType<SaveOperation>
Operation to save astore element
with defined options. -
Method Summary
Modifier and TypeMethodDescriptionvoid
perform
(@NotNull StoreElement element) Performs this operation on the given element.void
setComment
(@Nullable String comment) Defines the comment to be used for saving.void
setRecursionEnabled
(boolean enable) Defines, whether child elements should be saved, too.void
setValidationEnabled
(boolean enable) Defines, whether validation shall be performed on the element's data.
-
Field Details
-
TYPE
Operation to save astore element
with defined options.- Since:
- 5.2.1804
-
-
Method Details
-
setComment
Defines the comment to be used for saving.
If not set, defaults tonull
.- Parameters:
comment
- The comment to be set.- Since:
- 5.2.1804
-
setRecursionEnabled
void setRecursionEnabled(boolean enable) Defines, whether child elements should be saved, too. If enabled, children of the targeted element will be saved as well, as long as they are in a locked state. If saving a child fails for validation reasons, found problems will be returned in the accumulated report exception.
If not set, defaults tofalse
.- Parameters:
enable
- iftrue
, child elements of the given element will be saved as well.- Since:
- 5.2.1804
-
setValidationEnabled
void setValidationEnabled(boolean enable) Defines, whether validation shall be performed on the element's data.
If not set, defaults totrue
.- Parameters:
enable
- iftrue
, data will be validated before saving the element.- Since:
- 5.2.1804
-
perform
void perform(@NotNull @NotNull StoreElement element) throws ElementValidationReportsException, IllegalArgumentException Performs this operation on the given element. As a prerequisite, the element must belocked
.- Parameters:
element
- The element to be saved.- Throws:
ElementValidationReportsException
- If validating failed.IllegalArgumentException
- If the given element type is not supported.IllegalStateException
- If the given element is not locked.- Since:
- 5.2.1804
-