Class ProfileDB
java.lang.Object
com.example.slacks_lottoevent.database.ProfileDB
ProfileDB is a singleton class that manages the Firestore database for profiles.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Interface for listening to changes in the profiles cache. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileDB
Get the singleton instance of ProfileDB.void
Set the listener for profile changes.void
Start listening to Firestore updates for the profiles collection.void
Stop listening to Firestore updates.void
updateProfile
(Profile profile) Get the profiles cache.
-
Method Details
-
getInstance
Get the singleton instance of ProfileDB.- Returns:
- The singleton instance of ProfileDB.
-
startListening
public void startListening()Start listening to Firestore updates for the profiles collection. -
stopListening
public void stopListening()Stop listening to Firestore updates. -
setProfileChangeListener
Set the listener for profile changes.- Parameters:
listener
- the listener for profile changes
-
updateProfile
Get the profiles cache.- Parameters:
profile
- the profile to add to the cache
-