Class PreferenceMetadata<V>

  • Type Parameters:
    V - the value type for the preference

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

      Constructors 
      Constructor Description
      PreferenceMetadata​(java.lang.Class<V> clazz, java.lang.String identifier, V defaultValue, java.lang.String name)
      Created an instance of PreferenceMetadata using name as description
      PreferenceMetadata​(java.lang.Class<V> clazz, java.lang.String identifier, V defaultValue, java.lang.String name, java.lang.String description)
      Created an instance of PreferenceMetadata of all the the given parameters
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      V defaultValue()
      The default value for the preference.
      java.lang.String description()
      Widely describes the preference purpose, intended to be used in UI.
      java.lang.String identifer()
      The preference identifier to use as a key to access the preference value.
      java.lang.String name()
      Briefly describes the preference purpose, intended to be used in UI.
      java.lang.Class<V> valueClass()
      The type of preference value needed to perform type checks.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PreferenceMetadata

        public PreferenceMetadata​(java.lang.Class<V> clazz,
                                  java.lang.String identifier,
                                  V defaultValue,
                                  java.lang.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(Class, String, Object, String, String)
      • PreferenceMetadata

        public PreferenceMetadata​(java.lang.Class<V> clazz,
                                  java.lang.String identifier,
                                  V defaultValue,
                                  java.lang.String name,
                                  java.lang.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:
        PreferenceMetadata(Class, String, Object, String)
    • Method Detail

      • identifer

        public java.lang.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 java.lang.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 java.lang.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 java.lang.Class<V> valueClass()
        The type of preference value needed to perform type checks. Must not be null.
        Returns:
        the value class