Package com.syzygy.events.database
Class EventAssociation
java.lang.Object
com.syzygy.events.database.DatabaseInstance<EventAssociation>
com.syzygy.events.database.EventAssociation
- All Implemented Interfaces:
Database.Dissolvable
,Database.UpdateListener
An instance of an association of a user to an event
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
EventAssociation.Methods<T extends Database.Querrier<T>>
A query result of EventAssociations.static class
Stores the result of a mass notification.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
EventAssociation
(Database db, String assocID) Checks to make sure the generic type is the type of this instance -
Method Summary
Modifier and TypeMethodDescriptionprotected EventAssociation
cast()
Gets this instance casted to the generic typegetEvent()
com.google.firebase.Timestamp
com.google.firebase.firestore.GeoPoint
getUser()
methods()
Returns an object which contains methods that help notify the user or change the status of the association.NewInstance
(Database db, String eventID, com.google.firebase.firestore.GeoPoint location, String status, String userID, Database.InitializationListener<EventAssociation> listener) Validates and creates a new Image instance in the database using the given data.boolean
setLocation
(com.google.firebase.firestore.GeoPoint val) boolean
setStatus
(int resID) boolean
protected List<android.util.Pair<com.google.firebase.firestore.Query,
Database.Collections>> Validates and updates all properties of the assoc.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
-
EventAssociation
Checks to make sure the generic type is the type of this instance- Parameters:
db
- The databaseassocID
- The id of the association- Throws:
ClassCastException
-
-
Method Details
-
cast
Description copied from class:DatabaseInstance
Gets this instance casted to the generic type- Specified by:
cast
in classDatabaseInstance<EventAssociation>
- Returns:
- This as the generic type
-
getLocation
public com.google.firebase.firestore.GeoPoint getLocation() -
setLocation
public boolean setLocation(com.google.firebase.firestore.GeoPoint val) -
getEventID
-
getStatus
-
setStatus
-
setStatus
public boolean setStatus(int resID) -
getUserID
-
getUser
-
getEvent
-
getJoinTime
public com.google.firebase.Timestamp getJoinTime() -
update
Validates and updates all properties of the assoc. If the assoc changes, a notification is sent to listeners once and the database is updated once- Parameters:
location
- The location where the user signed into the eventstatus
- The status of the association- Returns:
- The ids of all invalid properties
- See Also:
-
subInstanceCascadeDeleteQuery
protected List<android.util.Pair<com.google.firebase.firestore.Query,Database.Collections>> subInstanceCascadeDeleteQuery()- Specified by:
subInstanceCascadeDeleteQuery
in classDatabaseInstance<EventAssociation>
- 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, @Dilutes String eventID, com.google.firebase.firestore.GeoPoint location, String status, @Dilutes String userID, Database.InitializationListener<EventAssociation> listener) Validates and creates a new Image instance in the database using the given data.- Parameters:
db
- The databaseeventID
- The ID of the eventlocation
- The location where the user signed into the eventstatus
- The status of the associationuserID
- The id of the userlistener
- Called once the instance is initialized. Not called if properties are invalid- Returns:
- The property id of all invalid properties
- See Also:
-
methods
Returns an object which contains methods that help notify the user or change the status of the association. This object must be called with.dissolve
once complete- Returns:
- The methods object
-