CopaApp
Change of Plan Application
 All Classes Functions Variables Pages
Public Member Functions | List of all members
unicopa.copa.base.UserSettings Class Reference

Represents the personal settings of a user. More...

Inheritance diagram for unicopa.copa.base.UserSettings:
Inheritance graph
Collaboration diagram for unicopa.copa.base.UserSettings:
Collaboration graph

Public Member Functions

 UserSettings (Set< String > gcmKeys, boolean emailNotification, String language, Map< Integer, UserEventSettings > eventSettings)
 The constructor for UserSettings that is used by the Mapper.
 
 UserSettings ()
 The default constructor for class UserSettings.
 
boolean addGCMKey (String key)
 Enable notifications for a Google Cloud Messaging key. More...
 
boolean removeGCMKey (String key)
 Disable notifications for a Google Cloud Messaging key. More...
 
Set< String > getGCMKeys ()
 Get the set of GCM keys. More...
 
void enableEmailNotification ()
 Enable notification by email.
 
void disableEmailNotification ()
 Disable notification by email.
 
boolean isEmailNotificationEnabled ()
 Check if email notification is enabled. More...
 
String getLanguage ()
 Get the user interface language that is currently set. More...
 
void setLanguage (String language)
 Set the user interface language. More...
 
UserEventSettings putEventSettings (int eventID, UserEventSettings settings)
 Associate the specified settings with the specified event. More...
 
UserEventSettings removeEventSettings (int eventID)
 Remove the settings that are associated with the specified event if it is present. More...
 
UserEventSettings getEventSettings (int eventID)
 Get the settings associated with the specified event. More...
 
boolean addSubscription (int eventID)
 Add a subscription for an event. More...
 
boolean removeSubscription (int eventID)
 Remove a subscribtion for an event. More...
 
boolean hasSubscribed (int eventID)
 Check if the user has subscribed to an event. More...
 
Set< Integer > getSubscriptions ()
 Returns the Set of the subscribed EventIDs. More...
 

Detailed Description

Represents the personal settings of a user.

Author
Felix Wiemuth

Member Function Documentation

boolean unicopa.copa.base.UserSettings.addGCMKey ( String  key)

Enable notifications for a Google Cloud Messaging key.

The key is added to the set of GCM keys. As long as a key resides in the user settings notifications will be sent over the Google Cloud Messaging for Android (GCM) service to the corresponding Android device.

Parameters
keythe GCM key to add
Returns
true if the key was not already contained in the set
boolean unicopa.copa.base.UserSettings.addSubscription ( int  eventID)

Add a subscription for an event.

The ID is added to the eventSettings map and a new UserEventSettings Object for that eventID is created

Parameters
eventIDthe ID of the event to subscribe to
Returns
true if the event was not already contained in the set
UserEventSettings unicopa.copa.base.UserSettings.getEventSettings ( int  eventID)

Get the settings associated with the specified event.

Parameters
eventIDthe ID of the event to get the settings for
Returns
the event settings associated with the specified event or null if there is no such association
Set<String> unicopa.copa.base.UserSettings.getGCMKeys ( )

Get the set of GCM keys.

Note that changes on the returned set are backed by this UserSettings object.

Returns
String unicopa.copa.base.UserSettings.getLanguage ( )

Get the user interface language that is currently set.

The default setting is "default".

Returns
Set<Integer> unicopa.copa.base.UserSettings.getSubscriptions ( )

Returns the Set of the subscribed EventIDs.

Returns
boolean unicopa.copa.base.UserSettings.hasSubscribed ( int  eventID)

Check if the user has subscribed to an event.

Parameters
eventIDthe ID of the event to check for
Returns
true if the user has subscribed to the sepcified event
boolean unicopa.copa.base.UserSettings.isEmailNotificationEnabled ( )

Check if email notification is enabled.

The default setting is false.

Returns
true if email notification is enabled
UserEventSettings unicopa.copa.base.UserSettings.putEventSettings ( int  eventID,
UserEventSettings  settings 
)

Associate the specified settings with the specified event.

Parameters
eventIDthe ID of the event with which the specified settings will be associated
settingsthe settings that will be associated with the specified event
Returns
the previous settings associated with the specified event or null if there was no such association
UserEventSettings unicopa.copa.base.UserSettings.removeEventSettings ( int  eventID)

Remove the settings that are associated with the specified event if it is present.

Parameters
eventIDthe ID of the event to remove the settings from
Returns
the previous settings associated with the specified event or null if there was no such association
boolean unicopa.copa.base.UserSettings.removeGCMKey ( String  key)

Disable notifications for a Google Cloud Messaging key.

The key is removed from the set of GCM keys.

Parameters
keythe GCM key to be removed
Returns
true if the key was contained in the set
boolean unicopa.copa.base.UserSettings.removeSubscription ( int  eventID)

Remove a subscribtion for an event.

The ID is removed from eventSettings map. The UserEventSettings for that event are removed as well

Parameters
eventIDthe event to unsubscribe
Returns
true if there has been a subscription to the specified event
void unicopa.copa.base.UserSettings.setLanguage ( String  language)

Set the user interface language.

Parameters
language

The documentation for this class was generated from the following file: