com.atlassian.jira.issue.comments
Class CommentImpl

java.lang.Object
  extended by com.atlassian.jira.issue.comments.CommentImpl
All Implemented Interfaces:
WithId, Comment, MutableComment

public class CommentImpl
extends Object
implements MutableComment

Represents a comment on an issue by a user. Comment is essentially a GenericValue wrapper with getters

See Also:
CommentManager.getCommentsForUser(com.atlassian.jira.issue.Issue, ApplicationUser)

Constructor Summary
CommentImpl(ProjectRoleManager projectRoleManager, ApplicationUser author, ApplicationUser updateAuthor, String body, String groupLevel, Long roleLevelId, Date created, Date updated, Issue issue)
          Creates a new instance of this class.
 
Method Summary
 boolean equals(Object obj)
           
 String getAuthor()
          Returns the key for the user that created the comment
 ApplicationUser getAuthorApplicationUser()
          Returns the user that created the comment
 String getAuthorFullName()
           
 String getAuthorKey()
          Returns the key for the user that created the comment
 com.atlassian.crowd.embedded.api.User getAuthorUser()
          Returns the User that created the comment
 String getBody()
           
 Date getCreated()
          Returns a date when this comment was created.
 String getGroupLevel()
           
 Long getId()
           
 Issue getIssue()
           
 ProjectRole getRoleLevel()
           
 Long getRoleLevelId()
           
 String getUpdateAuthor()
           
 ApplicationUser getUpdateAuthorApplicationUser()
          Get the user that performed the update
 String getUpdateAuthorFullName()
           
 com.atlassian.crowd.embedded.api.User getUpdateAuthorUser()
           
 Date getUpdated()
           
 int hashCode()
           
 void setAuthor(ApplicationUser author)
           
 void setAuthor(String author)
           
 void setBody(String body)
           
 void setCreated(Date created)
           
 void setGroupLevel(String groupLevel)
           
 void setRoleLevelId(Long roleLevelId)
           
 void setUpdateAuthor(ApplicationUser updateAuthor)
           
 void setUpdateAuthor(String updateAuthor)
           
 void setUpdated(Date updated)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentImpl

public CommentImpl(ProjectRoleManager projectRoleManager,
                   ApplicationUser author,
                   ApplicationUser updateAuthor,
                   String body,
                   String groupLevel,
                   Long roleLevelId,
                   Date created,
                   Date updated,
                   Issue issue)
            throws IllegalArgumentException
Creates a new instance of this class. The constructor id package protected in order to allow only the DefaultCommentManager to create new instances (a.k.a. comment factory)

Parameters:
projectRoleManager - project role manager
author - user name of the author, required
updateAuthor - user name of the author that has last updated
body - body of the comment, required
groupLevel - group visibility level
roleLevelId - role ID visibility level
created - created date, set to new Date if null
updated - updated date, set to created Date if null
issue - related issue
Throws:
IllegalArgumentException - if invalid data was passed
Method Detail

getAuthor

public String getAuthor()
Description copied from interface: Comment
Returns the key for the user that created the comment

Specified by:
getAuthor in interface Comment
Returns:
the key for the user that created the comment

getAuthorKey

public String getAuthorKey()
Description copied from interface: Comment
Returns the key for the user that created the comment

Specified by:
getAuthorKey in interface Comment
Returns:
the key for the user that created the comment

getAuthorUser

public com.atlassian.crowd.embedded.api.User getAuthorUser()
Description copied from interface: Comment
Returns the User that created the comment

Specified by:
getAuthorUser in interface Comment
Returns:
the User that created the comment.

getAuthorFullName

public String getAuthorFullName()
Specified by:
getAuthorFullName in interface Comment

getBody

public String getBody()
Specified by:
getBody in interface Comment

getCreated

public Date getCreated()
Returns a date when this comment was created. This is never null

Specified by:
getCreated in interface Comment
Returns:
creation date

getGroupLevel

public String getGroupLevel()
Specified by:
getGroupLevel in interface Comment

getId

public Long getId()
Specified by:
getId in interface WithId
Specified by:
getId in interface Comment
Returns:
the unique id of the entity.

getAuthorApplicationUser

public ApplicationUser getAuthorApplicationUser()
Description copied from interface: Comment
Returns the user that created the comment

Specified by:
getAuthorApplicationUser in interface Comment
Returns:
the user that created the comment

getUpdateAuthorUser

public com.atlassian.crowd.embedded.api.User getUpdateAuthorUser()
Specified by:
getUpdateAuthorUser in interface Comment
Returns:
a User object

getUpdateAuthorFullName

public String getUpdateAuthorFullName()
Specified by:
getUpdateAuthorFullName in interface Comment

getUpdated

public Date getUpdated()
Specified by:
getUpdated in interface Comment

setAuthor

public void setAuthor(ApplicationUser author)
Specified by:
setAuthor in interface MutableComment
Parameters:
author - ApplicationUser to be set as author.

setAuthor

public void setAuthor(String author)
Specified by:
setAuthor in interface MutableComment
Parameters:
author - userkey of the user to be set as author.

setBody

public void setBody(String body)
Specified by:
setBody in interface MutableComment

setGroupLevel

public void setGroupLevel(String groupLevel)
Specified by:
setGroupLevel in interface MutableComment

setRoleLevelId

public void setRoleLevelId(Long roleLevelId)
Specified by:
setRoleLevelId in interface MutableComment

setUpdateAuthor

public void setUpdateAuthor(ApplicationUser updateAuthor)
Specified by:
setUpdateAuthor in interface MutableComment
Parameters:
updateAuthor - ApplicationUser to be set as update author (i.e. the comment editor).

setCreated

public void setCreated(Date created)
Specified by:
setCreated in interface MutableComment

setUpdateAuthor

public void setUpdateAuthor(String updateAuthor)
Specified by:
setUpdateAuthor in interface MutableComment
Parameters:
updateAuthor - userkey of the user to be set as update author (i.e. the comment editor).

setUpdated

public void setUpdated(Date updated)
Specified by:
setUpdated in interface MutableComment

getRoleLevelId

public Long getRoleLevelId()
Specified by:
getRoleLevelId in interface Comment

getRoleLevel

public ProjectRole getRoleLevel()
Specified by:
getRoleLevel in interface Comment

getIssue

public Issue getIssue()
Specified by:
getIssue in interface Comment

getUpdateAuthor

public String getUpdateAuthor()
Specified by:
getUpdateAuthor in interface Comment
Returns:
userkey of the update author

getUpdateAuthorApplicationUser

public ApplicationUser getUpdateAuthorApplicationUser()
Description copied from interface: Comment
Get the user that performed the update

Specified by:
getUpdateAuthorApplicationUser in interface Comment
Returns:
an object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2002-2014 Atlassian. All Rights Reserved.