net.sf.okapi.common

## Class UserConfiguration

- java.lang.Object
- - java.util.Dictionary<K,V>
  - - java.util.Hashtable<java.lang.Object,java.lang.Object>
    - - java.util.Properties
      - - net.sf.okapi.common.UserConfiguration

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

      public class UserConfiguration
      extends java.util.Properties

  Simple class to store user-specific properties of an application in the user folder.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class java.util.Properties

      `defaults`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserConfiguration()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getBoolean(java.lang.String key)` Gets a boolean property value.
    `boolean` | `getBoolean(java.lang.String key, boolean defaultValue)` Gets a boolean property value possibly set to a default value.
    `int` | `getInteger(java.lang.String key)` Gets an integer property.
    `void` | `load(java.lang.String appName)` Load the user-specific application properties.
    `void` | `save(java.lang.String appName, java.lang.String version)` Save the user-specific application properties.
    `java.lang.Object` | `setProperty(java.lang.String key, boolean value)` Sets a boolean property.
    `java.lang.Object` | `setProperty(java.lang.String key, int value)` Sets an integer property.
    `java.lang.Object` | `setProperty(java.lang.String key, java.lang.String value)`

    - ### Methods inherited from class java.util.Properties

      `getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, store, store, storeToXML, storeToXML, stringPropertyNames`

    - ### Methods inherited from class java.util.Hashtable

      `clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UserConfiguration

          public UserConfiguration()

  - ### Method Detail

    - #### load

          public void load(java.lang.String appName)

      Load the user-specific application properties.
      Parameters:
        `appName` - the application name.

    - #### save

          public void save(java.lang.String appName,
                           java.lang.String version)

      Save the user-specific application properties.
      Parameters:
        `appName` - the application name.
        `version` - the application version, will be used in a comment.

    - #### setProperty

          public java.lang.Object setProperty(java.lang.String key,
                                              java.lang.String value)

      Overrides:
        `setProperty` in class `java.util.Properties`

    - #### getBoolean

          public boolean getBoolean(java.lang.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(java.lang.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 java.lang.Object setProperty(java.lang.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(java.lang.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 java.lang.Object setProperty(java.lang.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.