util.misc

## Class PropertyDefaults

- java.lang.Object
- - util.misc.PropertyDefaults

-     public class PropertyDefaults
      extends java.lang.Object

  A class that stores a HashMap with default values for Properties
  Since:
    3.3.4
  Author:
    René Mach

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PropertyDefaults(java.util.HashMap<java.lang.String,java.lang.String> defaultValueMap)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDefaultValueForKey(java.lang.String key)` Gets the default value of this property defaults for the given key.
    `java.util.Properties` | `getProperties()` Gets the properties to use for this property defaults.
    `java.lang.String` | `getValueFromProperties(java.lang.String key)` Gets the value for the given key from the previously set properties or the default value for the key of this property defaults.
    `java.lang.String` | `getValueFromProperties(java.lang.String key, java.util.Properties properties)` Gets the value for the given key from the given properties, the properties previously set if given properties is `null` or the default value for the key of this property defaults.
    `void` | `setProperties(java.util.Properties properties)` Sets the properties to use for this property defaults.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PropertyDefaults

          public PropertyDefaults(java.util.HashMap<java.lang.String,java.lang.String> defaultValueMap)

  - ### Method Detail

    - #### setProperties

          public void setProperties(java.util.Properties properties)

      Sets the properties to use for this property defaults.

      Parameters:
        `properties` - The properties to use.
      Since:
        3.4.1

    - #### getValueFromProperties

          public java.lang.String getValueFromProperties(java.lang.String key)

      Gets the value for the given key from the previously set properties or the default value for the key of this property defaults.
      Parameters:
        `key` - The key of the property value to get.
      Returns:
        A value or `null` if no value exists for the given key.
      Since:
        3.4.1

    - #### getValueFromProperties

          public java.lang.String getValueFromProperties(java.lang.String key,
                                                java.util.Properties properties)

      Gets the value for the given key from the given properties, the properties previously set if given properties is `null` or the default value for the key of this property defaults.
      Parameters:
        `key` - The key of the property value to get.
        `properties` - The properties to get the value from or `null` to use previously set properties or to get default value if no property is set.
      Returns:
        A value or `null` if no value exists for the given key.

    - #### getDefaultValueForKey

          public java.lang.String getDefaultValueForKey(java.lang.String key)

      Gets the default value of this property defaults for the given key.
      Parameters:
        `key` - The key of the property value default to get.
      Returns:
        The default value or `null` if no default value exists for the given key.

    - #### getProperties

          public java.util.Properties getProperties()

      Gets the properties to use for this property defaults.

      Returns:
        The previously set properties or `null` if no properties were set.
      Since:
        3.4.1

TV-Browser 3.4.3, Copyright (C) 2004-2008 TV-Browser Team (dev@tvbrowser.org)