Package org.polyfrost.oneconfig.utils.v1
Interface OverwriteMergeable
public interface OverwriteMergeable
Implemented by config values that need to preserve transient (non-serialized) state when a loaded value overwrites
them.
See OneConfigKeybind: its key action is transient and therefore lost on
deserialization, but the keys/modifiers are restored from disk. Merging the loaded keys into the existing keybind
keeps the action intact.
-
Method Summary
Modifier and TypeMethodDescriptionmergeOverwrite(Object incoming) Absorb the relevant state of [incoming] (the freshly-loaded/deserialized value) into this instance and return the value that should be stored in the property.
-
Method Details
-
mergeOverwrite
Absorb the relevant state of [incoming] (the freshly-loaded/deserialized value) into this instance and return the value that should be stored in the property.- Parameters:
incoming- the value being written over this one; never null- Returns:
- the value to store (usually
this)
-