Interface IFeatureSaveSupport
FeatureModelPersistenceManager to enable support for saving in-memory changes.
See this article for more information.
- Since:
- 2023.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidResets the unsaved (in-memory) changes of theIFeatureModel, returning theIFeatureModel'sstate back to that of its backend.List<@NotNull FeatureChange> Returns the list of all unsaved (in-memory) changes of theIFeatureModel.Saves the in-memory changes of theIFeatureModelin theIFeatureModel's backend (for example a file or database).
-
Method Details
-
saveChanges
Saves the in-memory changes of theIFeatureModelin theIFeatureModel's backend (for example a file or database).Typically, this method shouldn't modify the in-memory state of the model. So the feature model does not have to send out events through its
observers. In some cases however (depending on the model/save implementation), feature changes can occur while changes are saved. In that case, the model's observers need to be notified of those changes.- Returns:
nullon success, or error information on failure.
-
discardChanges
void discardChanges()Resets the unsaved (in-memory) changes of theIFeatureModel, returning theIFeatureModel'sstate back to that of its backend.Since this changes the in-memory state of the
IFeatureModel, the model'sobserversshould be notified with aFeatureModelEventcontainingfeature changesthat go from the current state to the backend's state. -
getChanges
Returns the list of all unsaved (in-memory) changes of theIFeatureModel.That is, the changes that need to be saved to the
IFeatureModel'sbackend to persist all in-memory changes.There should only be one
FeatureChangeper feature id. If a feature has been updated multiple times, it should be condensed into a singleFeatureChange. Note: If a feature has been deleted, and another feature with the same feature id was added, this condenses to a singleupdateFeatureChange.- Returns:
- the list of all unsaved (in-memory) changes of the
IFeatureModel.
-