com.vodafone360.people.service
Class PersistSettings

java.lang.Object
  extended by com.vodafone360.people.service.PersistSettings

public class PersistSettings
extends java.lang.Object

Class responsible for handling persistent settings within the People client. These settings are stored in the State table in the People client's database.


Nested Class Summary
static class PersistSettings.InternetAvail
          Internet availability settings, options are always connect or only allow manual connection
static class PersistSettings.Option
          Definition of a set of options handled by PersistSettings.
static class PersistSettings.OptionType
          Definition for Settings type (boolean, string, integer, long).
 
Field Summary
private  PersistSettings.Option mOption
           
private  java.lang.Object mValue
           
 
Constructor Summary
PersistSettings()
          Constructor
 
Method Summary
static boolean addToContentValues(ContentValues contentValues, PersistSettings setting)
          Add setting from supplied PersistSettings instance to supplied ContentValues instance.
 int describeContents()
          
static java.lang.Object fetchValueFromCursor(Cursor c, int colIndex, java.lang.String key)
          Fetch Object from database Cursor.
private static boolean getDefaultBoolean(PersistSettings.Option option)
          Return the default (boolean) value for supplied Option.
private static int getDefaultInt(PersistSettings.Option option)
          Return the default (integer) value for supplied Option.
 boolean getFirstTimeMeSyncComplete()
           
 boolean getFirstTimeMeSyncStarted()
           
 boolean getFirstTimeNativeSyncComplete()
          Return value indicating whether first time native contact sync has completed.
 boolean getFirstTimeSyncComplete()
          Return value indicating whether first time native contact sync has completed.
 boolean getFirstTimeSyncStarted()
          Return value indicating whether first time native contact sync has started.
 PersistSettings.InternetAvail getInternetAvail()
          Get current InternetAvail value
 PersistSettings.Option getOption()
          Get Option associated with this PersistSettings.
private  java.lang.Object getValue()
          Get value associated with this PersistSettings.
 void putDefaultOptionData()
          Set the default value stored in PersistDettings for current Option.
 void putDefaultOptionData(PersistSettings.Option option)
          Set the default value stored in PersistDettings for specified Option.
 void putFirstTimeMeSyncComplete(boolean value)
           
 void putFirstTimeMeSyncStarted(boolean value)
           
 void putFirstTimeNativeSyncComplete(boolean value)
          Store value indicating whether first time native contact sync has completed.
 void putFirstTimeSyncComplete(boolean value)
          Store value indicating whether first time contact sync has completed.
 void putFirstTimeSyncStarted(boolean value)
          Store value indicating whether first time native contact sync has started.
 void putInternetAvail(PersistSettings.InternetAvail value)
          Set Internet availability value.
 void putOptionData(PersistSettings.Option option, java.lang.Object data)
          Set the default value for the specified Option
 java.lang.String toString()
          
 void writeToParcel(Parcel dest, int flags)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mOption

private PersistSettings.Option mOption

mValue

private java.lang.Object mValue
Constructor Detail

PersistSettings

public PersistSettings()
Constructor

Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getDefaultBoolean

private static boolean getDefaultBoolean(PersistSettings.Option option)
Return the default (boolean) value for supplied Option.

Parameters:
option - Option
Returns:
default boolean value for specified Option or false if if the default value is null or not a boolean.

getDefaultInt

private static int getDefaultInt(PersistSettings.Option option)
Return the default (integer) value for supplied Option.

Parameters:
option - Option
Returns:
default integer value for specified Option or false if if the default value is null or not a integer.

putDefaultOptionData

public void putDefaultOptionData(PersistSettings.Option option)
Set the default value stored in PersistDettings for specified Option.

Parameters:
option - Option the default value held by PersistSettings is the value set in the supplied Option.

putDefaultOptionData

public void putDefaultOptionData()
Set the default value stored in PersistDettings for current Option.


putOptionData

public void putOptionData(PersistSettings.Option option,
                          java.lang.Object data)
Set the default value for the specified Option

Parameters:
option - Option to set default data for.
data - Value for default setting.

addToContentValues

public static boolean addToContentValues(ContentValues contentValues,
                                         PersistSettings setting)
Add setting from supplied PersistSettings instance to supplied ContentValues instance.

Parameters:
contentValues - ContentValue to update.
setting - PersistSettings instance containing settings value.
Returns:
true (cannot return false!).

fetchValueFromCursor

public static java.lang.Object fetchValueFromCursor(Cursor c,
                                                    int colIndex,
                                                    java.lang.String key)
Fetch Object from database Cursor.

Parameters:
c - Database Cursor pointing to item of interest.
colIndex - Column index within item.
key - Key used to obtain required Option item.
Returns:
Value obtained for Cursor, null if option does not exist or key does not match valid Option.

putInternetAvail

public void putInternetAvail(PersistSettings.InternetAvail value)
Set Internet availability value.

Parameters:
value - InternetAvail.

getInternetAvail

public PersistSettings.InternetAvail getInternetAvail()
Get current InternetAvail value

Returns:
current InternetAvail value.

getFirstTimeNativeSyncComplete

public boolean getFirstTimeNativeSyncComplete()
Return value indicating whether first time native contact sync has completed.

Returns:
stored boolean value indicating whether first time native contact sync has completed.

putFirstTimeNativeSyncComplete

public void putFirstTimeNativeSyncComplete(boolean value)
Store value indicating whether first time native contact sync has completed.

Parameters:
value - value indicating whether first time native contact sync has completed.

putFirstTimeSyncComplete

public void putFirstTimeSyncComplete(boolean value)
Store value indicating whether first time contact sync has completed.

Parameters:
value - value indicating whether first time native contact sync has completed.

putFirstTimeMeSyncComplete

public void putFirstTimeMeSyncComplete(boolean value)

getFirstTimeSyncComplete

public boolean getFirstTimeSyncComplete()
Return value indicating whether first time native contact sync has completed.

Returns:
value indicating whether first time native contact sync has completed.

getFirstTimeMeSyncComplete

public boolean getFirstTimeMeSyncComplete()

putFirstTimeSyncStarted

public void putFirstTimeSyncStarted(boolean value)
Store value indicating whether first time native contact sync has started.

Parameters:
value - value indicating whether first time native contact sync has started.

putFirstTimeMeSyncStarted

public void putFirstTimeMeSyncStarted(boolean value)

getFirstTimeSyncStarted

public boolean getFirstTimeSyncStarted()
Return value indicating whether first time native contact sync has started.

Returns:
value indicating whether first time native contact sync has started.

getFirstTimeMeSyncStarted

public boolean getFirstTimeMeSyncStarted()

getOption

public PersistSettings.Option getOption()
Get Option associated with this PersistSettings.

Returns:
Option associated with this PersistSettings.

getValue

private java.lang.Object getValue()
Get value associated with this PersistSettings.

Returns:
Object representing value associated with this PersistSettings.

describeContents

public int describeContents()


writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)



JavaDoc