Class PrefEntry

  • All Implemented Interfaces:
    java.lang.Comparable<PrefEntry>

    public class PrefEntry
    extends java.lang.Object
    implements java.lang.Comparable<PrefEntry>
    Class to store single preference line for the table.
    Since:
    6021
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefEntry​(java.lang.String key, Setting<?> value, Setting<?> defaultValue, boolean isDefault)
      Constructs a new PrefEntry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(PrefEntry other)  
      boolean equals​(java.lang.Object obj)  
      Setting<?> getDefaultValue()
      Returns the preference default value.
      java.lang.String getKey()
      Returns the preference key.
      Setting<?> getValue()
      Returns the preference value.
      int hashCode()  
      boolean isChanged()
      Determines if this preference entry has been modified.
      boolean isDefault()
      Determines if the current value is the default value.
      void markAsChanged()
      Marks this preference entry as modified.
      void reset()
      Resets this preference entry to default state.
      void setValue​(Setting<?> value)
      Sets the preference value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PrefEntry

        public PrefEntry​(java.lang.String key,
                         Setting<?> value,
                         Setting<?> defaultValue,
                         boolean isDefault)
        Constructs a new PrefEntry.
        Parameters:
        key - The preference key
        value - The preference value
        defaultValue - The preference default value
        isDefault - determines if the current value is the default value
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Returns the preference key.
        Returns:
        the preference key
      • getValue

        public Setting<?> getValue()
        Returns the preference value.
        Returns:
        the preference value
      • getDefaultValue

        public Setting<?> getDefaultValue()
        Returns the preference default value.
        Returns:
        the preference default value
      • setValue

        public void setValue​(Setting<?> value)
        Sets the preference value.
        Parameters:
        value - the preference value
      • isDefault

        public boolean isDefault()
        Determines if the current value is the default value.
        Returns:
        true if the current value is the default value, false otherwise
      • isChanged

        public boolean isChanged()
        Determines if this preference entry has been modified.
        Returns:
        true if this preference entry has been modified, false otherwise
      • markAsChanged

        public void markAsChanged()
        Marks this preference entry as modified.
      • reset

        public void reset()
        Resets this preference entry to default state.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object