Public Member Functions | |
PropertiesMenuStateSerialiser (MenuTree tree, Path propertiesFile) | |
void | loadMenuStatesAndApply () |
List< AnyMenuState > | loadMenuStates () |
void | saveMenuStates () |
An implementation of menu state serialization that stores data in a properties file at a given location.
var tree = new MenuTree(); var propStore = new PropertiesMenuStateSerialiser(tree, Path.of("./props.properties")); propStore.loadMenuStatesAndApply(); // Some time later... propStore.saveMenuStates();
List<AnyMenuState> com.thecoderscorner.menu.persist.PropertiesMenuStateSerialiser.loadMenuStates | ( | ) |
load the menu states but do not apply them to the tree
Implements com.thecoderscorner.menu.persist.MenuStateSerialiser.
void com.thecoderscorner.menu.persist.PropertiesMenuStateSerialiser.loadMenuStatesAndApply | ( | ) |
load back all states from the storage and apply them all to the tree, after this all items in the tree will contain the updated value.
Implements com.thecoderscorner.menu.persist.MenuStateSerialiser.
void com.thecoderscorner.menu.persist.PropertiesMenuStateSerialiser.saveMenuStates | ( | ) |
Save the latest state of the tree into storage.
Implements com.thecoderscorner.menu.persist.MenuStateSerialiser.