Interface UpdateChecker
- All Known Implementing Classes:
RecordingAttributeUpdateChecker,TimedUpdateChecker
@PublicSpi
public interface UpdateChecker
An implementor of this interface checks for an external change that may affect a built forest fragment. It checks for changes those happened after the forest fragment had been generated.
Here is a basic implementation:
state = collectState(); // Collect whatever is required to build a forest // Generate a forest based on the state context.addUpdateChecker(() -> !state.equals(collectState())); // If something has changed, the Structure has to regenerate the forest
If the forest fragment depends only on items those changes are reported to ItemTracker
you may consider to addItemChangeFilter.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if there is any change that affects a generated forest fragment.
-
Method Details
-
hasUpdate
boolean hasUpdate()Checks if there is any change that affects a generated forest fragment.- Returns:
- true the forest fragment is outdated and Structure has to regenerate the it. false if the fragment is still up to date.
-