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 interfaceInterface for listening to changes in the profiles cache. -
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileDBGet the singleton instance of ProfileDB.voidSet the listener for profile changes.voidStart listening to Firestore updates for the profiles collection.voidStop listening to Firestore updates.voidupdateProfile(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
-