Class EventComment

java.lang.Object
com.example.breeze_seas.EventComment

public final class EventComment extends Object
EventComment stores one event-scoped comment document from events/{eventId}/comments/{commentId}.
  • Constructor Details

    • EventComment

      public EventComment()
      Creates an empty comment model for Firestore hydration.
    • EventComment

      public EventComment(@NonNull String commentId, @NonNull String authorDeviceId, @NonNull String authorDisplayName, @NonNull String body, boolean authorOrganizer, @Nullable com.google.firebase.Timestamp createdTimestamp)
      Creates a fully populated event comment model.
      Parameters:
      commentId - Unique identifier of the comment document.
      authorDeviceId - Device identifier of the comment author.
      authorDisplayName - Visible author name shown in the UI.
      body - Comment text content.
      authorOrganizer - Whether the author posted as an organizer.
      createdTimestamp - Timestamp when the comment was created.
  • Method Details

    • toMap

      @NonNull public Map<String,Object> toMap()
      Serializes the comment into the Firestore field map used by the comments subcollection.
      Returns:
      Firestore field map for this comment.
    • getCommentId

      @NonNull public String getCommentId()
      Returns the stable comment identifier.
      Returns:
      Comment document identifier.
    • setCommentId

      public void setCommentId(@Nullable String commentId)
      Stores the stable comment identifier.
      Parameters:
      commentId - Comment document identifier.
    • getAuthorDeviceId

      @NonNull public String getAuthorDeviceId()
      Returns the device identifier of the comment author.
      Returns:
      Author device identifier.
    • setAuthorDeviceId

      public void setAuthorDeviceId(@Nullable String authorDeviceId)
      Stores the device identifier of the comment author.
      Parameters:
      authorDeviceId - Author device identifier.
    • getAuthorDisplayName

      @NonNull public String getAuthorDisplayName()
      Returns the visible author label for the comment.
      Returns:
      Display name of the author.
    • setAuthorDisplayName

      public void setAuthorDisplayName(@Nullable String authorDisplayName)
      Stores the visible author label for the comment.
      Parameters:
      authorDisplayName - Display name of the author.
    • getBody

      @NonNull public String getBody()
      Returns the text body of the comment.
      Returns:
      Comment body text.
    • setBody

      public void setBody(@Nullable String body)
      Stores the text body of the comment.
      Parameters:
      body - Comment body text.
    • isAuthorOrganizer

      public boolean isAuthorOrganizer()
      Returns whether the comment was authored by an organizer.
      Returns:
      true when the comment is from an organizer.
    • setAuthorOrganizer

      public void setAuthorOrganizer(boolean authorOrganizer)
      Stores whether the comment was authored by an organizer.
      Parameters:
      authorOrganizer - Organizer-author flag.
    • getCreatedTimestamp

      @Nullable public com.google.firebase.Timestamp getCreatedTimestamp()
      Returns the timestamp when the comment was created.
      Returns:
      Comment creation timestamp, or null when unavailable.
    • setCreatedTimestamp

      public void setCreatedTimestamp(@Nullable com.google.firebase.Timestamp createdTimestamp)
      Stores the timestamp when the comment was created.
      Parameters:
      createdTimestamp - Comment creation timestamp.