java.lang.Object
org.openstreetmap.josm.gui.preferences.advanced.PrefEntry
All Implemented Interfaces:
Comparable<PrefEntry>

public class PrefEntry extends Object implements Comparable<PrefEntry>
Class to store single preference line for the table.
Since:
6021
  • Field Details

  • Constructor Details

    • 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 Details

    • 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.
    • compareTo

      public int compareTo(PrefEntry other)
      Specified by:
      compareTo in interface Comparable<PrefEntry>
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object