com.atlassian.crucible.spi.data
Interface CommentData

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
CommentDataImpl, GeneralCommentData, VersionedCommentData, VersionedLineCommentData

public interface CommentData
extends java.io.Serializable

Common attributes of comments on items and general comments on reviews.


Nested Class Summary
static class CommentData.Status
           
 
Method Summary
 java.util.Date getCreateDate()
          Get the comment's creation date.
 java.lang.String getMessage()
           
 java.util.Map<java.lang.String,CustomFieldData> getMetrics()
           
 PermId<CommentData> getParentCommentId()
          Get the perma-id of the comment that this comment is a reply to.
 java.lang.String getPermaIdAsString()
          Get the comment's perma-id.
 CommentData.Status getReadStatus()
          Get the read status of the comment with respect to the user who requested the comment.
 java.util.List<GeneralCommentData> getReplies()
          Get the direct replies to the comment.
 UserData getUser()
          Get the comment's author.
 boolean isDefectApproved()
           
 boolean isDefectRaised()
           
 boolean isDeleted()
           
 boolean isDraft()
           
 void setCreateDate(java.util.Date date)
          Set the comment's creation date.
 void setDefectApproved(boolean defectApproved)
           
 void setDefectRaised(boolean defectRaised)
           
 void setDeleted(boolean deleted)
           
 void setDraft(boolean draft)
           
 void setMessage(java.lang.String message)
           
 void setMetrics(java.util.Map<java.lang.String,CustomFieldData> metrics)
           
 void setParentCommentId(PermId<CommentData> parentId)
          Set the parent comment of this comment.
 void setPermaIdAsString(java.lang.String permaId)
          Set the comment's perma-id.
 void setReadStatus(CommentData.Status status)
          Set the comment's read status with respect to the user making the request.
 void setReplies(java.util.List<GeneralCommentData> replies)
          Set the replies for the comment.
 void setUser(UserData user)
          Set the comment's author.
 

Method Detail

getPermaIdAsString

java.lang.String getPermaIdAsString()
Get the comment's perma-id.


setPermaIdAsString

void setPermaIdAsString(java.lang.String permaId)
Set the comment's perma-id.

This field should not be set by client code. Perma-ids are allocated when a comment is created.


getMessage

java.lang.String getMessage()

setMessage

void setMessage(java.lang.String message)

isDraft

boolean isDraft()

setDraft

void setDraft(boolean draft)

isDeleted

boolean isDeleted()

setDeleted

void setDeleted(boolean deleted)

isDefectRaised

boolean isDefectRaised()

setDefectRaised

void setDefectRaised(boolean defectRaised)

isDefectApproved

boolean isDefectApproved()

setDefectApproved

void setDefectApproved(boolean defectApproved)

getReadStatus

CommentData.Status getReadStatus()
Get the read status of the comment with respect to the user who requested the comment.


setReadStatus

void setReadStatus(CommentData.Status status)
Set the comment's read status with respect to the user making the request.

This field should not be set by client code. For the author of the comment, the read status is always READ, thus it is set to this value upon creation. To update the read status for other users, see markCommentAsRead, markCommentAsLeaveUnread, and markAllCommentsAsRead.


getUser

UserData getUser()
Get the comment's author.


setUser

void setUser(UserData user)
Set the comment's author.

This field should not be set by client code. When creating or updating a comment, it is ignored: the user who requested the comment creation is set as its author.


getCreateDate

java.util.Date getCreateDate()
Get the comment's creation date.


setCreateDate

void setCreateDate(java.util.Date date)
Set the comment's creation date.

This field should not be set by client code. When creating or updating a comment, it is ignored: the date when the comment was created is set as its creation date.


getReplies

java.util.List<GeneralCommentData> getReplies()
Get the direct replies to the comment. To get nested replies, get the replies of the replies returned by this method.


setReplies

void setReplies(java.util.List<GeneralCommentData> replies)
Set the replies for the comment.

When creating or updating a comment, it is illegal to set the replies for that comment. You should create or update each comment individually.


getMetrics

java.util.Map<java.lang.String,CustomFieldData> getMetrics()

setMetrics

void setMetrics(java.util.Map<java.lang.String,CustomFieldData> metrics)

getParentCommentId

PermId<CommentData> getParentCommentId()
Get the perma-id of the comment that this comment is a reply to.

Returns:
the parent comment's perma-id or a PermId with a null value for id

setParentCommentId

void setParentCommentId(PermId<CommentData> parentId)
Set the parent comment of this comment.

This field should not be set by client code. When creating or updating a comment, it is ignored: it is set (automatically) for replies only.

Parameters:
parentId - the perma-id of the parent of this comment
See Also:
ReviewService.addReply(com.atlassian.crucible.spi.PermId, GeneralCommentData)