Package org.eclipse.handly.ui.preference

# Class PreferenceChangeEvent

java.lang.Object
org.eclipse.handly.ui.preference.PreferenceChangeEvent

public final class PreferenceChangeEvent extends Object
Describes a change in the value of a preference.

Note: The type of the old and new values of the preference in a `PreferenceChangeEvent` is determined by whether or not the change was made via the typed preference API. If the value of a preference was changed via the typed API (e.g., via `IBooleanPreference`), the values in the `PreferenceChangeEvent` will be of the appropriate specific type. If a non-typed API was used (e.g., OSGi `Preferences`), the values will be unconverted Strings.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getNewValue()`
  Returns the new value of the preference.
  `Object`
  `getOldValue()`
  Returns the old value of the preference.
  `IPreference`
  `getPreference()`
  Returns the changed preference.

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

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

- ## Method Details

  - ### getPreference

    public IPreference getPreference()
    Returns the changed preference.
    Returns:
      the changed preference (never `null`)

  - ### getOldValue

    public Object getOldValue()
    Returns the old value of the preference.
    Returns:
      the old value, or `null` if not known or not relevant (e.g., if the preference was just added and there was no old value)

  - ### getNewValue

    public Object getNewValue()
    Returns the new value of the preference.
    Returns:
      the new value, or `null` if not known or not relevant (e.g., if the preference was removed)