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

public class EventDB extends Object
EventDB is a singleton class that manages the events in the Firestore database.
  • Method Details

    • getInstance

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

      public void startListening()
      Starts listening for Firestore updates for the events collection.
    • stopListening

      public void stopListening()
      Stops listening to the events in the Firestore database.
    • setEventChangeListener

      public void setEventChangeListener(EventDB.EventChangeListener listener)
      Sets the EventChangeListener for this EventDB.
      Parameters:
      listener - the EventChangeListener to set
    • notifyEventChangeListener

      public void notifyEventChangeListener()
      Notifies the EventChangeListener that the events have changed.
    • updateEvent

      public void updateEvent(Event event)
      Adds an event to the Firestore database.
      Parameters:
      event - the event to add