Skip to content

Commit 686eb76

Browse files
committed
Add method to simplify settings updater
1 parent 0e0a79b commit 686eb76

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/com/saicone/settings/update/SettingsUpdater.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ public SettingsUpdater(@Nullable List<NodeUpdate> nodeUpdates) {
5656
this.nodeUpdates = nodeUpdates;
5757
}
5858

59+
/**
60+
* Update the given base node.
61+
*
62+
* @param base the base node to apply updates into.
63+
* @return true if any update has been applied into base node.
64+
*/
65+
public boolean update(@NotNull MapNode base) {
66+
return update(base, null);
67+
}
68+
5969
/**
6070
* Update the given base node along with optional provider map node.
6171
*
@@ -104,4 +114,13 @@ public List<NodeUpdate> getNodeUpdates() {
104114
}
105115
return nodeUpdates;
106116
}
117+
118+
/**
119+
* Add a node update to this instance.
120+
*
121+
* @param update the node update to add.
122+
*/
123+
public void add(@NotNull NodeUpdate update) {
124+
getNodeUpdates().add(update);
125+
}
107126
}

0 commit comments

Comments
 (0)