jetbrains.buildServer.serverSide.comments
Class Comment

java.lang.Object
  extended by jetbrains.buildServer.serverSide.comments.Comment

public abstract class Comment
extends java.lang.Object

This class represents various comments in TeamCity. Comment attributes are user, comment, and timestamp. Any of the fields (excluding timestamp) can be null.

See Also:
CommentManager

Field Summary
protected  java.util.Date myTimestamp
           
 
Constructor Summary
Comment(long commentId, SUser user, java.lang.String comment, java.util.Date when)
          Comment constructor
 
Method Summary
abstract  void delete()
          Delete this comment from the database
 java.lang.String getComment()
           
 long getCommentId()
           
 java.util.Date getTimestamp()
           
 SUser getUser()
           
 long getUserId()
           
abstract  boolean save()
           
 void setCurrentInfo(SUser user, java.lang.String comment)
          Set comment current information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myTimestamp

protected java.util.Date myTimestamp
Constructor Detail

Comment

public Comment(long commentId,
               SUser user,
               java.lang.String comment,
               java.util.Date when)
Comment constructor

Parameters:
comment - comment text
commentId - comment identifier
user - user who made the comment
when - when comment was updated
Method Detail

getComment

@Nullable
public java.lang.String getComment()
Returns:
comment text

getTimestamp

@NotNull
public java.util.Date getTimestamp()
Returns:
when comment was updated last time

getCommentId

public long getCommentId()
Returns:
database comment identifier

getUser

@Nullable
public SUser getUser()
Returns:
user who made the comment

getUserId

public long getUserId()
Returns:
id of user who made the comment, -1 if not available

setCurrentInfo

public void setCurrentInfo(@Nullable
                           SUser user,
                           java.lang.String comment)
Set comment current information. Must call save() to persist this information in the database.

Parameters:
user - comment author
comment - comment text

save

public abstract boolean save()
Returns:
true if the save operation was successful

delete

public abstract void delete()
Delete this comment from the database