Package ghidra.docking.settings

# Class SettingsImpl

java.lang.Object
ghidra.docking.settings.SettingsImpl

All Implemented Interfaces:
  `Settings`, `Serializable`

public class SettingsImpl extends Object implements Settings, Serializable
Basic implementation of the Settings object

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final Settings`
  `NO_SETTINGS`

  ### Fields inherited from interface ghidra.docking.settings.Settings

  `EMPTY_STRING_ARRAY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SettingsImpl()`
  Construct a new SettingsImpl.
  `SettingsImpl(boolean immutable)`
  Construct a new SettingsImpl.
  `SettingsImpl(Settings settings)`
  Construct a new SettingsImpl object.
  `SettingsImpl(Predicate<String> allowedSettingPredicate)`
  Construct a new SettingsImpl with a modification predicate.
  `SettingsImpl(ChangeListener listener, Object changeSourceObj)`
  Construct a new SettingsImpl with the given listener

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearAllSettings()`
  Removes all name-value pairs from this settings object
  `void`
  `clearSetting(String name)`
  Removes any value associated with the given name
  `Settings`
  `getDefaultSettings()`
  Returns the underlying default settings for these settings or null if there are none
  `Long`
  `getLong(String name)`
  Gets the Long value associated with the given name
  `String[]`
  `getNames()`
  Get this list of keys that currently have values associated with them
  `String`
  `getString(String name)`
  Gets the String value associated with the given name
  `Object`
  `getValue(String name)`
  Gets the object associated with the given name
  `boolean`
  `isChangeAllowed(SettingsDefinition settingsDefinition)`
  Determine if a settings change corresponding to the specified settingsDefinition is permitted.
  `boolean`
  `isEmpty()`
  Returns true if there are no key-value pairs stored in this settings object.
  `boolean`
  `isImmutableSettings()`
  Returns true if settings may not be modified.
  `void`
  `setDefaultSettings(Settings settings)`
  `void`
  `setLong(String name, long value)`
  Associates the given long value with the name.
  `void`
  `setString(String name, String value)`
  Associates the given String value with the name.
  `void`
  `setValue(String name, Object value)`
  Associates the given object with the name.
  `String`
  `toString()`

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

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

  ### Methods inherited from interface ghidra.docking.settings.Settings

  `getSuggestedValues`

- ## Field Details

  - ### NO_SETTINGS

    public static final Settings NO_SETTINGS

- ## Constructor Details

  - ### SettingsImpl

    public SettingsImpl()
    Construct a new SettingsImpl.

  - ### SettingsImpl

    public SettingsImpl(Predicate<String> allowedSettingPredicate)
    Construct a new SettingsImpl with a modification predicate.
    Parameters:
      `allowedSettingPredicate` - callback for checking an allowed setting modification

  - ### SettingsImpl

    public SettingsImpl(Settings settings)
    Construct a new SettingsImpl object. If settings object is specified this settings will copy all name/value pairs and underlying defaults.
    Parameters:
      `settings` - the settings object to copy

  - ### SettingsImpl

    public SettingsImpl(boolean immutable)
    Construct a new SettingsImpl.
    Parameters:
      `immutable` - if true settings are immutable with the exception of setting its default settings. If false settings may be modified.

  - ### SettingsImpl

    public SettingsImpl(ChangeListener listener, Object changeSourceObj)
    Construct a new SettingsImpl with the given listener
    Parameters:
      `listener` - object to be notified as settings values change
      `changeSourceObj` - source object to be associated with change events

- ## Method Details

  - ### isImmutableSettings

    public boolean isImmutableSettings()
    Description copied from interface: `Settings`
    Returns true if settings may not be modified.
    Specified by:
      `isImmutableSettings` in interface `Settings`
    Returns:
      true if settings may not be modified

  - ### isChangeAllowed

    public boolean isChangeAllowed(SettingsDefinition settingsDefinition)
    Description copied from interface: `Settings`
    Determine if a settings change corresponding to the specified settingsDefinition is permitted.
    Specified by:
      `isChangeAllowed` in interface `Settings`
    Parameters:
      `settingsDefinition` - settings definition
    Returns:
      true if change permitted else false

  - ### toString

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

  - ### isEmpty

    public boolean isEmpty()
    Description copied from interface: `Settings`
    Returns true if there are no key-value pairs stored in this settings object. This is not a reflection of the underlying default settings which may still contain a key-value pair when this settings object is empty.
    Specified by:
      `isEmpty` in interface `Settings`
    Returns:
      true if there are no key-value pairs stored in this settings object

  - ### getLong

    public Long getLong(String name)
    Description copied from interface: `Settings`
    Gets the Long value associated with the given name
    Specified by:
      `getLong` in interface `Settings`
    Parameters:
      `name` - the key used to retrieve a value
    Returns:
      the Long value for a key

  - ### getString

    public String getString(String name)
    Description copied from interface: `Settings`
    Gets the String value associated with the given name
    Specified by:
      `getString` in interface `Settings`
    Parameters:
      `name` - the key used to retrieve a value
    Returns:
      the String value for a key

  - ### setLong

    public void setLong(String name, long value)
    Description copied from interface: `Settings`
    Associates the given long value with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name).
    Specified by:
      `setLong` in interface `Settings`
    Parameters:
      `name` - the key
      `value` - the value associated with the key

  - ### setString

    public void setString(String name, String value)
    Description copied from interface: `Settings`
    Associates the given String value with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name).
    Specified by:
      `setString` in interface `Settings`
    Parameters:
      `name` - the key
      `value` - the value associated with the key

  - ### clearSetting

    public void clearSetting(String name)
    Description copied from interface: `Settings`
    Removes any value associated with the given name
    Specified by:
      `clearSetting` in interface `Settings`
    Parameters:
      `name` - the key to remove any association

  - ### getNames

    public String[] getNames()
    Description copied from interface: `Settings`
    Get this list of keys that currently have values associated with them
    Specified by:
      `getNames` in interface `Settings`
    Returns:
      an array of string keys.

  - ### getValue

    public Object getValue(String name)
    Description copied from interface: `Settings`
    Gets the object associated with the given name
    Specified by:
      `getValue` in interface `Settings`
    Parameters:
      `name` - the key used to retrieve a value
    Returns:
      the object associated with a given key

  - ### setValue

    public void setValue(String name, Object value)
    Description copied from interface: `Settings`
    Associates the given object with the name. Note that an attempted setting change may be ignored if prohibited (e.g., immutable Settings, undefined setting name).
    Specified by:
      `setValue` in interface `Settings`
    Parameters:
      `name` - the key
      `value` - the value to associate with the key

  - ### clearAllSettings

    public void clearAllSettings()
    Description copied from interface: `Settings`
    Removes all name-value pairs from this settings object
    Specified by:
      `clearAllSettings` in interface `Settings`

  - ### setDefaultSettings

    public void setDefaultSettings(Settings settings)

  - ### getDefaultSettings

    public Settings getDefaultSettings()
    Description copied from interface: `Settings`
    Returns the underlying default settings for these settings or null if there are none
    Specified by:
      `getDefaultSettings` in interface `Settings`
    Returns:
      underlying default settings or null