Class FacilityDB

java.lang.Object
com.example.slacks_lottoevent.database.FacilityDB

public class FacilityDB extends Object
FacilityDB is a singleton class that manages the Firestore database for facilities.
  • Method Details

    • getInstance

      public static FacilityDB getInstance()
      Get the singleton instance of FacilityDB.
      Returns:
      the singleton instance of FacilityDB
    • startListening

      public void startListening()
      Start listening to Firestore updates for the facilities collection.
    • stopListening

      public void stopListening()
      Stop listening to Firestore updates.
    • setFacilityChangeListener

      public void setFacilityChangeListener(FacilityDB.FacilityChangeListener listener)
      Set the facility change listener.
      Parameters:
      listener - the facility change listener
    • updateFacility

      public com.google.android.gms.tasks.Task<Void> updateFacility(String name, String streetAddress, String deviceId)
      Add a new facility to the Firestore database.
      Parameters:
      name - the name of the facility
      streetAddress - the street address of the facility
      deviceId - the device ID of the organizer
      Returns:
      a Task representing the completion of the operation