com.atlassian.jira.issue.comments
Class CommentImpl

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

public class CommentImpl
extends java.lang.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, com.opensymphony.user.User)

Constructor Summary
CommentImpl(CommentManager manager, java.lang.String author, java.lang.String updateAuthor, java.lang.String body, java.lang.String groupLevel, java.lang.Long roleLevelId, java.util.Date created, java.util.Date updated, Issue issue)
          Creates a new instance of this class.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAuthor()
           
 java.lang.String getAuthorFullName()
           
 com.opensymphony.user.User getAuthorObject()
          Get the user that created the comment
 java.lang.String getBody()
           
 java.util.Date getCreated()
          Returns a date when this comment was created.
 java.lang.String getGroupLevel()
           
 java.lang.Long getId()
           
 Issue getIssue()
           
 ProjectRole getRoleLevel()
           
 java.lang.Long getRoleLevelId()
           
 java.lang.String getUpdateAuthor()
           
 java.lang.String getUpdateAuthorFullName()
           
 com.opensymphony.user.User getUpdateAuthorObject()
          Get the user that performed the update
 java.util.Date getUpdated()
           
 int hashCode()
           
 void setAuthor(java.lang.String author)
           
 void setBody(java.lang.String body)
           
 void setCreated(java.util.Date created)
           
 void setGroupLevel(java.lang.String groupLevel)
           
 void setRoleLevelId(java.lang.Long roleLevelId)
           
 void setUpdateAuthor(java.lang.String updateAuthor)
           
 void setUpdated(java.util.Date updated)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentImpl

public CommentImpl(CommentManager manager,
                   java.lang.String author,
                   java.lang.String updateAuthor,
                   java.lang.String body,
                   java.lang.String groupLevel,
                   java.lang.Long roleLevelId,
                   java.util.Date created,
                   java.util.Date updated,
                   Issue issue)
            throws java.lang.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:
manager - comment 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:
java.lang.IllegalArgumentException - if ivalid data was passed
Method Detail

getAuthor

public java.lang.String getAuthor()
Specified by:
getAuthor in interface Comment

getAuthorObject

public com.opensymphony.user.User getAuthorObject()
Description copied from interface: Comment
Get the user that created the comment

Specified by:
getAuthorObject in interface Comment
Returns:
a User object

getAuthorFullName

public java.lang.String getAuthorFullName()
Specified by:
getAuthorFullName in interface Comment

getBody

public java.lang.String getBody()
Specified by:
getBody in interface Comment

getCreated

public java.util.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 java.lang.String getGroupLevel()
Specified by:
getGroupLevel in interface Comment

getId

public java.lang.Long getId()
Specified by:
getId in interface Comment

getUpdateAuthor

public java.lang.String getUpdateAuthor()
Specified by:
getUpdateAuthor in interface Comment

getUpdateAuthorObject

public com.opensymphony.user.User getUpdateAuthorObject()
Description copied from interface: Comment
Get the user that performed the update

Specified by:
getUpdateAuthorObject in interface Comment
Returns:
a User object

getUpdateAuthorFullName

public java.lang.String getUpdateAuthorFullName()
Specified by:
getUpdateAuthorFullName in interface Comment

getUpdated

public java.util.Date getUpdated()
Specified by:
getUpdated in interface Comment

setAuthor

public void setAuthor(java.lang.String author)
Specified by:
setAuthor in interface MutableComment

setBody

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

setGroupLevel

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

setRoleLevelId

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

setCreated

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

setUpdateAuthor

public void setUpdateAuthor(java.lang.String updateAuthor)
Specified by:
setUpdateAuthor in interface MutableComment

setUpdated

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

getRoleLevelId

public java.lang.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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2002-2010 Atlassian. All Rights Reserved.