com.vodafone360.people
Class SettingsManager

java.lang.Object
  extended by com.vodafone360.people.SettingsManager

public final class SettingsManager
extends java.lang.Object

Handles default application settings. Stores default values for: - Server URLS (Direct API and RPG) - Upgrade URL - Feature flags for enabling/disabling functionality These values are overwritten by during the build configuration files to allow different lifecycles to enable specific features, and to target specific back end environments. Property defaults are set in the Settings.java file.


Field Summary
private static java.lang.String COMMA
          Comma string.
private static java.util.Hashtable<java.lang.String,java.lang.Object> sSettings
          Static settings HashTable.
 
Constructor Summary
private SettingsManager()
          Private constructor to prevent instantiation.
 
Method Summary
static boolean getBooleanProperty(java.lang.String key)
          Get boolean property value for key.
static java.lang.String getProperty(java.lang.String key)
          Get property value for a specific key.
private static java.lang.String[] getStringArray(java.lang.String value)
          Get a String array out of the given comma separated values.
static java.lang.String[] getStringArrayProperty(java.lang.String key)
          Gets an array of strings for a specific key.
static void loadProperties(Context context)
          Load properties from build configuration files.
static void setProperty(java.lang.String key, java.lang.String value)
          Sets a property made of a key and its associated value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMA

private static final java.lang.String COMMA
Comma string.

See Also:
Constant Field Values

sSettings

private static java.util.Hashtable<java.lang.String,java.lang.Object> sSettings
Static settings HashTable.

Constructor Detail

SettingsManager

private SettingsManager()
Private constructor to prevent instantiation.

Method Detail

loadProperties

public static void loadProperties(Context context)
Load properties from build configuration files.

Parameters:
context - Android Context.
Throws:
java.lang.NullPointerException - Configuration file not found.
java.lang.NullPointerException - context is NULL.

getProperty

public static java.lang.String getProperty(java.lang.String key)
Get property value for a specific key.

Parameters:
key - Key for required property.
Returns:
property value.

getBooleanProperty

public static boolean getBooleanProperty(java.lang.String key)
Get boolean property value for key.

Parameters:
key - Key for required property.
Returns:
boolean key value.

getStringArrayProperty

public static java.lang.String[] getStringArrayProperty(java.lang.String key)
Gets an array of strings for a specific key.

Parameters:
key - Key for required property.
Returns:
String array property value, NULL if key is NULL or HashTable of settings is NULL.

getStringArray

private static java.lang.String[] getStringArray(java.lang.String value)
Get a String array out of the given comma separated values.

Parameters:
value - Comma separated values
Returns:
String array from given comma separated values.

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.String value)
Sets a property made of a key and its associated value. Note: Currently only used for JUnit testing to force specific values.

Parameters:
key - the key
value - the value associated with the key
Throws:
java.lang.NullPointerException - loadProperties() has not yet been called.


JavaDoc