de.unikassel.android.sdcframework.preferences.facade
Interface SinglePreference<T>

Package class diagram package SinglePreference
Type Parameters:
T - the preference value type
All Known Subinterfaces:
SensorDevicePreferences, ServicePreferences, TimeProviderPreference, TransmissionPreference, TransmissionProtocolPreference, UUIDPreference
All Known Implementing Classes:
BooleanPreference, EnabledPreference, FrequencyPreference, IntegerPreference, LogLevelPreferenceImpl, LongPreference, PriorityLevelPreference, SensorDevicePreferencesImpl, ServicePreferencesImpl, SinglePreferenceImpl, StringPreference, TimeProviderPreferenceImpl, TransmissionPreferenceImpl, TransmissionProtocolPreferenceImpl, UUIDPreferenceImpl

public interface SinglePreference<T>

Generic interface for a single preference with a default value.

A single preference has a value type, a preference key, a default value and can extract it's configuration value from the shared preferences.


Method Summary
 T getConfiguration(SharedPreferences sharedPreferences)
          Getter for the current value in the shared preferences
 T getDefault()
          Getter for the default value
 String getKey()
          Getter for the preference key
 void setDefault(T defaultValue)
          Setter for the default value
 boolean testForKey(String key)
          Method to test for a preferences key support
 

Method Detail

getKey

String getKey()
Getter for the preference key

Returns:
the preference key

getConfiguration

T getConfiguration(SharedPreferences sharedPreferences)
Getter for the current value in the shared preferences

Parameters:
sharedPreferences - the shared application preferences
Returns:
the current value

getDefault

T getDefault()
Getter for the default value

Returns:
the default value

setDefault

void setDefault(T defaultValue)
Setter for the default value

Parameters:
defaultValue - the default value to set

testForKey

boolean testForKey(String key)
Method to test for a preferences key support

Parameters:
key - the key to test for
Returns:
true if this key is supported, false otherwise