Class AbstractManagementPanelWithProperties<T extends Comparable>

    • Field Detail

      • m_Properties

        protected Properties m_Properties
        the underlying properties.
    • Constructor Detail

      • AbstractManagementPanelWithProperties

        public AbstractManagementPanelWithProperties()
    • Method Detail

      • getProperties

        protected abstract Properties getProperties()
        Returns the properties to work with. Loads them, if necessary.
        Returns:
        the properties
      • storeProperties

        protected abstract boolean storeProperties()
        Saves the properties on disk.
        Returns:
        true if successfully saved
      • createKey

        protected abstract String createKey​(T value)
        Creates the key for storing the object in the properties.
        Parameters:
        value - the object to create the key from
        Returns:
        the generated key
      • fromString

        protected abstract T fromString​(String s)
        Turns the string obtained from the properties file into an object.
        Parameters:
        s - the string to parse
        Returns:
        the generated object, null if failed to generate
      • toString

        protected abstract String toString​(T value)
        Turns the object into a string to be stored in the properties file.
        Parameters:
        value - the object to convert
        Returns:
        the generated strings
      • exists

        protected boolean exists​(T value)
        Checks whether the object already exists.
        Specified by:
        exists in class AbstractManagementPanel<T extends Comparable>
        Parameters:
        value - the value to look for
        Returns:
        true if already available
      • store

        protected boolean store​(T value)
        Stores the object.
        Specified by:
        store in class AbstractManagementPanel<T extends Comparable>
        Parameters:
        value - the value to store
        Returns:
        true if successfully stored
      • remove

        protected boolean remove​(T value)
        Removes the object.
        Specified by:
        remove in class AbstractManagementPanel<T extends Comparable>
        Parameters:
        value - the value to remove
        Returns:
        true if successfully removed
      • getID

        protected String getID​(T value)
        Returns the ID from the object.
        Overrides:
        getID in class AbstractManagementPanel<T extends Comparable>
        Parameters:
        value - the object to get the ID from
        Returns:
        the ID, null if it could not be retrieved