Class AbstractProperty<T>

    • Constructor Detail

      • AbstractProperty

        protected AbstractProperty​(java.lang.String key,
                                   T defaultValue)
        Constructs a new AbstractProperty.
        Parameters:
        key - The property key
        defaultValue - The default value
        Since:
        5464
    • Method Detail

      • storeDefaultValue

        protected void storeDefaultValue()
        Store the default value to the preferences.
      • getKey

        public java.lang.String getKey()
        Replies the property key.
        Returns:
        The property key
      • isSet

        public boolean isSet()
        Determines if this property is currently set in JOSM preferences.
        Returns:
        true if getPreferences() contains this property.
      • getDefaultValue

        public T getDefaultValue()
        Replies the default value of this property.
        Returns:
        The default value of this property
      • remove

        public void remove()
        Removes this property from JOSM preferences (i.e replace it by its default value).
      • get

        public abstract T get()
        Replies the value of this property.
        Returns:
        the value of this property
        Since:
        5464
      • put

        public abstract boolean put​(T value)
        Sets this property to the specified value.
        Parameters:
        value - The new value of this property
        Returns:
        true if something has changed (i.e. value is different than before)
        Since:
        5464
      • getPreferences

        protected IPreferences getPreferences()
        Gets the preferences used for this property.
        Returns:
        The preferences for this property.
        Since:
        12999
      • 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