Package ghidra.util

# Class SaveableColor

java.lang.Object
ghidra.util.PrivateSaveable
ghidra.util.SaveableColor

All Implemented Interfaces:
  `Saveable`

public class SaveableColor extends PrivateSaveable

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SaveableColor()`
  `SaveableColor(Color color)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `Color`
  `getColor()`
  `Class<?>[]`
  `getObjectStorageFields()`
  Returns the field classes, in Java types, in the same order as used `Saveable.save(ghidra.util.ObjectStorage)` and `Saveable.restore(ghidra.util.ObjectStorage)`.
  `int`
  `getSchemaVersion()`
  Get the storage schema version.
  `int`
  `hashCode()`
  `boolean`
  `isUpgradeable(int oldSchemaVersion)`
  Determine if the implementation supports an storage upgrade of the specified oldSchemaVersion to the current schema version.
  `void`
  `restore(ObjectStorage objStorage)`
  Restore from the given ObjectStorage.
  `void`
  `save(ObjectStorage objStorage)`
  Save to the given ObjectStorage.
  `String`
  `toString()`
  `boolean`
  `upgrade(ObjectStorage oldObjStorage, int oldSchemaVersion, ObjectStorage currentObjStorage)`
  Upgrade an older stored object to the current storage schema.

  ### Methods inherited from class ghidra.util.PrivateSaveable

  `isPrivate`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SaveableColor

    public SaveableColor(Color color)

  - ### SaveableColor

    public SaveableColor()

- ## Method Details

  - ### save

    public void save(ObjectStorage objStorage)
    Description copied from interface: `Saveable`
    Save to the given ObjectStorage.
    Parameters:
      `objStorage` - Object that can handle Java primitives, Strings, and arrays of primitives and Strings

  - ### getObjectStorageFields

    public Class<?>[] getObjectStorageFields()
    Description copied from interface: `Saveable`
    Returns the field classes, in Java types, in the same order as used `Saveable.save(ghidra.util.ObjectStorage)` and `Saveable.restore(ghidra.util.ObjectStorage)`.

    For example, if the save method calls `objStorage.putInt()` and then `objStorage.putFloat()`, then this method must return `Class[]{ Integer.class, Float.class }`.

    Returns:

  - ### restore

    public void restore(ObjectStorage objStorage)
    Description copied from interface: `Saveable`
    Restore from the given ObjectStorage.
    Parameters:
      `objStorage` - Object that can handle Java primitives, Strings, and arrays of primitives and Strings TODO: document how errors should be handled (i.e, exception, null return)

  - ### getColor

    public Color getColor()

  - ### getSchemaVersion

    public int getSchemaVersion()
    Description copied from interface: `Saveable`
    Get the storage schema version. Any time there is a software release in which the implementing class has changed the data structure used for the save and restore methods, the schema version must be incremented. NOTE: While this could be a static method, the Saveable interface is unable to define such methods.
    Returns:
      storage schema version.

  - ### isUpgradeable

    public boolean isUpgradeable(int oldSchemaVersion)
    Description copied from interface: `Saveable`
    Determine if the implementation supports an storage upgrade of the specified oldSchemaVersion to the current schema version.
    Parameters:
      `oldSchemaVersion` -
    Returns:
      true if upgrading is supported for the older schema version.

  - ### upgrade

    public boolean upgrade(ObjectStorage oldObjStorage, int oldSchemaVersion, ObjectStorage currentObjStorage)
    Description copied from interface: `Saveable`
    Upgrade an older stored object to the current storage schema.
    Parameters:
      `oldObjStorage` - the old stored object
      `oldSchemaVersion` - storage schema version number for the old object
      `currentObjStorage` - new object for storage in the current schema
    Returns:
      true if data was upgraded to the currentObjStorage successfully.

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`