Package com.syzygy.events.database
Class Notification
- All Implemented Interfaces:
Database.Dissolvable
,Database.UpdateListener
An instance of a notification database item
- A notification item cannot be edited
-
Nested Class Summary
Nested classes/interfaces inherited from class com.syzygy.events.database.DatabaseInstance
DatabaseInstance.DeletionType, DatabaseInstance.InstancePropertyWrapper<W extends DatabaseInstance<W>>, DatabaseInstance.PropertyField<V,
W extends DatabaseInstance<W>>, DatabaseInstance.PropertyWrapper<V, W extends DatabaseInstance<W>> Nested classes/interfaces inherited from interface com.syzygy.events.database.Database.UpdateListener
Database.UpdateListener.Type
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final DatabaseInstance.PropertyField<?,
?>[] The list of the fields defined for a UserFields inherited from class com.syzygy.events.database.DatabaseInstance
db, iproperties, properties
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Notification
(Database db, String id) Checks to make sure the generic type is the type of this instance -
Method Summary
Modifier and TypeMethodDescriptionprotected Notification
cast()
Gets this instance casted to the generic typegetBody()
getEvent()
com.google.firebase.Timestamp
NewInstance
(Database db, String subject, String body, String eventID, String receiverID, String senderID, Boolean ignoresOptOut, Database.InitializationListener<Notification> listener) Validates and creates a new notification instance in the database using the given data.protected List<android.util.Pair<com.google.firebase.firestore.Query,
Database.Collections>> Methods inherited from class com.syzygy.events.database.DatabaseInstance
addInitializationListener, addListener, assertNotIllegalState, deleteInstance, dereferenceInstance, dissolve, dissolve, doesPropertyLoadInstance, fetch, fetch, fullDissolve, getAssociatedImage, getAssociatedImageLocName, getCollection, getCollectionReference, getData, getDatabaseID, getDocumentID, getDocumentReference, getFields, getPropertyInstance, getPropertyInstanceI, getPropertyValue, getPropertyValueI, initializeData, isDataValid, isDataValid, isLegalState, isPropertyEditable, isPropertyValid, isPropertyValid, isReferenced, modifyData, notifyUpdate, onUpdate, processUpdate, removeListener, requiredFirstDelete, setAssociatedImage, setPropertyInstance, setPropertyValue, subDereferenceInstance, subInitialize, toString, updateDataFromDatabase, updateDataFromMap, updateDataFromMap
-
Field Details
-
fields
The list of the fields defined for a User
-
-
Constructor Details
-
Notification
Checks to make sure the generic type is the type of this instance- Parameters:
db
- The databaseid
- The id of the notification- Throws:
ClassCastException
-
-
Method Details
-
cast
Description copied from class:DatabaseInstance
Gets this instance casted to the generic type- Specified by:
cast
in classDatabaseInstance<Notification>
- Returns:
- This as the generic type
-
getSubject
-
getBody
-
getSentTime
public com.google.firebase.Timestamp getSentTime() -
getIsRead
-
getEventID
-
getSenderID
-
getReceiverID
-
getEvent
-
getSender
-
getReceiver
-
setIsRead
-
ignoresOptOutSettings
-
subInstanceCascadeDeleteQuery
protected List<android.util.Pair<com.google.firebase.firestore.Query,Database.Collections>> subInstanceCascadeDeleteQuery()- Specified by:
subInstanceCascadeDeleteQuery
in classDatabaseInstance<Notification>
- Returns:
- A list of all querries that should be run whose instances will be deleted when this instance is deleted
-
NewInstance
@MustStir public static Set<Integer> NewInstance(Database db, String subject, String body, @Dilutes String eventID, @Dilutes String receiverID, @Dilutes String senderID, Boolean ignoresOptOut, Database.InitializationListener<Notification> listener) Validates and creates a new notification instance in the database using the given data.Sets
isRead
tofalse
- Parameters:
db
- The databasesubject
- The subject of the notificationbody
- The body of the notificationeventID
- The ID of the event associated to the notificationreceiverID
- The id of the receiversenderID
- The id of the senderignoresOptOut
- If the notification cannot be opted out oflistener
- Will be called once the notification is initialized. Is not called if the data is invalid- Returns:
- The property id of all invalid properties
- See Also:
-