Class UserConfiguration

    • Constructor Detail

      • UserConfiguration

        public UserConfiguration()
    • Method Detail

      • load

        public void load​(String appName)
        Load the user-specific application properties.
        Parameters:
        appName - the application name.
      • save

        public void save​(String appName,
                         String version)
        Save the user-specific application properties.
        Parameters:
        appName - the application name.
        version - the application version, will be used in a comment.
      • getBoolean

        public boolean getBoolean​(String key)
        Gets a boolean property value.
        Parameters:
        key - The name of the property.
        Returns:
        True if the property exists and is set to "true", false if it does not exists or if it is set to "false".
      • getBoolean

        public boolean getBoolean​(String key,
                                  boolean defaultValue)
        Gets a boolean property value possibly set to a default value.
        Parameters:
        key - the name of the property.
        defaultValue - the default value.
        Returns:
        the value of the property if it exists, or the default value if it does not exist.
      • setProperty

        public Object setProperty​(String key,
                                  boolean value)
        Sets a boolean property.
        Parameters:
        key - The name of the property.
        value - The new value for the property.
        Returns:
        The previous value of the property, or null if the property did not exists yet.
      • getInteger

        public int getInteger​(String key)
        Gets an integer property.
        Parameters:
        key - The name of the property.
        Returns:
        The integer value of the property if it exists, 0 if it does not exists.
      • setProperty

        public Object setProperty​(String key,
                                  int value)
        Sets an integer property.
        Parameters:
        key - The name of the property.
        value - The new value for the property.
        Returns:
        The previous value of the property, or null if the property did not exist.