Class SimpleProperty<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Property<T>

    public class SimpleProperty<T>
    extends java.lang.Object
    implements Property<T>
    Simple implementation of a property.
    Since:
    1.15
    • Constructor Detail

      • SimpleProperty

        public SimpleProperty​(java.lang.String name,
                              T defaultValue)
        The constructor.
        Parameters:
        name - the name of the property
        defaultValue - the default value
    • Method Detail

      • setValue

        public void setValue​(T value)
        Description copied from interface: Property
        Set the new value.
        Specified by:
        setValue in interface Property<T>
        Parameters:
        value - the value
      • getName

        public java.lang.String getName()
        Description copied from interface: Property
        Get the name of the property.
        Specified by:
        getName in interface Property<T>
        Returns:
        the value
      • getValue

        public T getValue()
        Description copied from interface: Property
        Get the current value.
        Specified by:
        getValue in interface Property<T>
        Returns:
        the value
      • getDefault

        public T getDefault()
        Description copied from interface: Property
        Returns the default value.
        Specified by:
        getDefault in interface Property<T>
        Returns:
        the value
      • resetToDefault

        public T resetToDefault()
        Description copied from interface: Property
        Resets the value to the initial value and returns the new value.
        Specified by:
        resetToDefault in interface Property<T>
        Returns:
        the value
      • dispose

        public void dispose()
        Description copied from interface: Property
        Dispose the value.
        Specified by:
        dispose in interface Property<T>