Package com.example.breeze_seas
Class EventComment
java.lang.Object
com.example.breeze_seas.EventComment
EventComment stores one event-scoped comment document from
events/{eventId}/comments/{commentId}.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty comment model for Firestore hydration.EventComment(String commentId, String authorDeviceId, String authorDisplayName, String body, boolean authorOrganizer, com.google.firebase.Timestamp createdTimestamp) Creates a fully populated event comment model. -
Method Summary
Modifier and TypeMethodDescriptionReturns the device identifier of the comment author.Returns the visible author label for the comment.getBody()Returns the text body of the comment.Returns the stable comment identifier.com.google.firebase.TimestampReturns the timestamp when the comment was created.booleanReturns whether the comment was authored by an organizer.voidsetAuthorDeviceId(String authorDeviceId) Stores the device identifier of the comment author.voidsetAuthorDisplayName(String authorDisplayName) Stores the visible author label for the comment.voidsetAuthorOrganizer(boolean authorOrganizer) Stores whether the comment was authored by an organizer.voidStores the text body of the comment.voidsetCommentId(String commentId) Stores the stable comment identifier.voidsetCreatedTimestamp(com.google.firebase.Timestamp createdTimestamp) Stores the timestamp when the comment was created.toMap()Serializes the comment into the Firestore field map used by the comments subcollection.
-
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
Serializes the comment into the Firestore field map used by the comments subcollection.- Returns:
- Firestore field map for this comment.
-
getCommentId
Returns the stable comment identifier.- Returns:
- Comment document identifier.
-
setCommentId
Stores the stable comment identifier.- Parameters:
commentId- Comment document identifier.
-
getAuthorDeviceId
Returns the device identifier of the comment author.- Returns:
- Author device identifier.
-
setAuthorDeviceId
Stores the device identifier of the comment author.- Parameters:
authorDeviceId- Author device identifier.
-
getAuthorDisplayName
Returns the visible author label for the comment.- Returns:
- Display name of the author.
-
setAuthorDisplayName
Stores the visible author label for the comment.- Parameters:
authorDisplayName- Display name of the author.
-
getBody
Returns the text body of the comment.- Returns:
- Comment body text.
-
setBody
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:
truewhen 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
nullwhen unavailable.
-
setCreatedTimestamp
public void setCreatedTimestamp(@Nullable com.google.firebase.Timestamp createdTimestamp) Stores the timestamp when the comment was created.- Parameters:
createdTimestamp- Comment creation timestamp.
-