Class ThreadNotifications
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.cooler.ThreadNotifications
- All Implemented Interfaces:
Serializable, Comparable<Object>, IDBean, Cacheable
A bean to store notifications for a Water Cooler message thread.
- Since:
- 1.0
- Version:
- 4.2
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUser(int id) Adds a user to the notification list.voidAdds a user to the notification list.booleancontains(int id) Returns whether a particular user is signed up to receive notifications.getIDs()Returns the database IDs of all users signed up for notifications.voidremoveUser(int id) Removes a user from the notification list.voidremoveUser(Person p) Removes a user from the notification list.Methods inherited from class DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intbooleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.inthashCode()voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.
-
Constructor Details
-
ThreadNotifications
public ThreadNotifications(int id) Creates a new Thread Notifcation bean.- Parameters:
id- the message thread database ID
-
-
Method Details
-
addUser
public void addUser(int id) Adds a user to the notification list.- Parameters:
id- the Person's database ID- See Also:
-
addUser
Adds a user to the notification list.- Parameters:
p- the Person- See Also:
-
removeUser
public void removeUser(int id) Removes a user from the notification list.- Parameters:
id- the Person's database ID- See Also:
-
removeUser
Removes a user from the notification list.- Parameters:
p- the Person- See Also:
-
getIDs
Returns the database IDs of all users signed up for notifications.- Returns:
- a Collection of Integers
-
contains
public boolean contains(int id) Returns whether a particular user is signed up to receive notifications.- Parameters:
id- the Person's database ID- Returns:
- TRUE if the Person is signed up, otherwise FALSE
-