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 where the key action is transient and therefore lost on deserialization while the keys and modifiers are restored from disk

Merging the loaded keys into the existing keybind keeps the action intact

  • Method Summary

    Modifier and Type
    Method
    Description
    Absorb the relevant state of [incoming] into this instance and return the value that should be stored in the property
  • Method Details

    • mergeOverwrite

      Object mergeOverwrite(Object incoming)
      Absorb the relevant state of [incoming] into this instance and return the value that should be stored in the property

      [incoming] is the freshly loaded deserialized value

      Parameters:
      incoming - the value being written over this one

      never null

      Returns:
      the value to store

      usually this