Class PrefEntry

    • Constructor Detail

      • PrefEntry

        public PrefEntry​(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 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.