Class EventCommentsDB

java.lang.Object
com.example.breeze_seas.EventCommentsDB

public final class EventCommentsDB extends Object
EventCommentsDB provides event-scoped Firestore access for realtime comment viewing, posting, and organizer deletion.
  • Constructor Details

    • EventCommentsDB

      public EventCommentsDB()
      Creates a Firestore-backed comments data helper.
  • Method Details

    • startCommentsListen

      public void startCommentsListen(@NonNull String eventId, @NonNull EventCommentsDB.CommentsUpdatedCallback callback)
      Starts listening for realtime comments updates on one event.
      Parameters:
      eventId - Identifier of the event whose comments should be observed.
      callback - Listener that receives updated comment snapshots and errors.
    • stopCommentsListen

      public void stopCommentsListen()
      Stops the active realtime comments listener, if one exists.
    • addComment

      public void addComment(@NonNull Event event, @Nullable User user, @NonNull String body, boolean authorOrganizer, @NonNull EventCommentsDB.CommentMutationCallback callback)
      Adds one new comment to the given event's comments subcollection.
      Parameters:
      event - Event receiving the new comment.
      user - Current app user who is posting the comment.
      body - Comment text content to save.
      authorOrganizer - Whether the author is posting as an organizer.
      callback - Listener notified when the mutation succeeds or fails.
    • deleteComment

      public void deleteComment(@NonNull String eventId, @NonNull String commentId, @NonNull EventCommentsDB.CommentMutationCallback callback)
      Deletes one comment from the given event's comments subcollection.
      Parameters:
      eventId - Identifier of the event that owns the comment.
      commentId - Identifier of the comment document to remove.
      callback - Listener notified when the mutation succeeds or fails.