Class PreferenceMetadata<V>

java.lang.Object
org.eclipse.core.runtime.preferences.PreferenceMetadata<V>
Type Parameters:
V - the value type for the preference

public final class PreferenceMetadata<V> extends Object
The preference metadata provides the information needed to configure everything about the preference except the preference value itself.
Since:
3.8
See Also:
  • Constructor Details

    • PreferenceMetadata

      public PreferenceMetadata(Class<V> clazz, String identifier, V defaultValue, String name)
      Created an instance of PreferenceMetadata using name as description
      Parameters:
      clazz - the value type of the preference, must not be null
      identifier - the identifier of the preference, must not be null
      defaultValue - the default value of the preference, must not be null
      name - the name of the preference, must not be null
      See Also:
    • PreferenceMetadata

      public PreferenceMetadata(Class<V> clazz, String identifier, V defaultValue, String name, String description)
      Created an instance of PreferenceMetadata of all the the given parameters
      Parameters:
      clazz - the value type of the preference, must not be null
      identifier - the identifier of the preference, must not be null
      defaultValue - the default value of the preference, must not be null
      name - the name of the preference, must not be null
      description - the description of the preference, must not be null
      See Also:
  • Method Details

    • identifer

      public String identifer()
      The preference identifier to use as a key to access the preference value. Must not be null.
      Returns:
      the identifier
    • defaultValue

      public V defaultValue()
      The default value for the preference. Must not be null.
      Returns:
      the default value
    • name

      public String name()
      Briefly describes the preference purpose, intended to be used in UI. Must not be null and should be localized. Should not be blank.
      Returns:
      the name
    • description

      public String description()
      Widely describes the preference purpose, intended to be used in UI. Must not be null and should be localized. May be blank.
      Returns:
      the description
    • valueClass

      public Class<V> valueClass()
      The type of preference value needed to perform type checks. Must not be null.
      Returns:
      the value class