Package com.syzygy.events.database
Enum Class Database.Collections
- All Implemented Interfaces:
Serializable
,Comparable<Database.Collections>
,Constable
- Enclosing class:
- Database
Contains the different collections stored in the database;
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The Firestore identifier for the collectionstatic final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the property id of the associated image for a instance of this collection.com.google.firebase.firestore.CollectionReference
Returns the database collection objectReturns the document IDgetDatabaseID
(DatabaseInstance<?> instance) Returns a unique identifier for the instance within the full databasegetDatabaseID
(String documentID) Returns a unique identifier for the instance within the full databasecom.google.firebase.firestore.DocumentReference
getDocument
(Database db, String documentID) Gets the document within the collection.(package private) String
instanceIDFromDatabaseID
(String databaseID) Gets the instance id from the database id(package private) <T extends DatabaseInstance<T>>
DatabaseInstance<T>newInstance
(Database db, String id) Returns a new instance of the collection item with the idstatic Database.Collections
Returns the enum constant of this class with the specified name.static Database.Collections[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USERS
-
EVENTS
-
FACILITIES
-
NOTIFICATIONS
-
IMAGES
-
EVENT_ASSOCIATIONS
-
-
Field Details
-
dbIdentifier
The Firestore identifier for the collection -
DOES_NOT_HAVE_ASSOCIATED_IMAGE
public static final int DOES_NOT_HAVE_ASSOCIATED_IMAGE- See Also:
-
IS_ITS_OWN_ASSOCIATED_IMAGE
public static final int IS_ITS_OWN_ASSOCIATED_IMAGE- See Also:
-
-
Constructor Details
-
Collections
private Collections()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getDatabaseID
Returns a unique identifier for the instance within the full database- Parameters:
instance
- The database instance- Returns:
- The unique database identifier
-
getDatabaseID
Returns a unique identifier for the instance within the full database- Parameters:
documentID
- The unique identifier of the instance within the collection- Returns:
- The unique database identifier
-
instanceIDFromDatabaseID
Gets the instance id from the database id- Parameters:
databaseID
- The unique identifier of the instance within the database- Returns:
- The unique identifier of the instance within the collection
-
getCollectionID
Returns the document ID- Returns:
- The document ID
-
getCollection
Returns the database collection object- Parameters:
db
- The database- Returns:
- The
CollectionReference
for the collection
-
getDocument
Gets the document within the collection. If no document exists, creates a new document.- Parameters:
db
- The databasedocumentID
- The document identifier within the collection- Returns:
- The
DocumentReference
for the document
-
getNewID
- Parameters:
db
- The database- Returns:
- A new unique id for the collection
-
newInstance
@NonNull @Salty <T extends DatabaseInstance<T>> DatabaseInstance<T> newInstance(Database db, String id) Returns a new instance of the collection item with the id- Type Parameters:
T
- The instance type- Parameters:
db
- The databaseid
- The document id- Returns:
- The new instance
-
getAssociatedImagePropertyId
public int getAssociatedImagePropertyId()Returns the property id of the associated image for a instance of this collection. If this collection does not have associated images, returns-1
. If the instance is itself the associated image, returns-2
-