예제 #1
0
 public void addComment(Comment comment) {
   if (!comment.isCommentSet()) {
     List<Comment> commentList = getComments();
     commentList.add(comment);
     comment.commentSet = true;
   }
 }
예제 #2
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Comment comment = (Comment) o;

    if (id != null ? !id.equals(comment.id) : comment.id != null) return false;
    if (comment != null ? !comment.equals(comment.comment) : comment.comment != null) return false;
    return !(timeAdded != null ? !timeAdded.equals(comment.timeAdded) : comment.timeAdded != null);
  }
예제 #3
0
파일: TaskData.java 프로젝트: rcernich/jbpm
  /**
   * Removes the Comment specified by the commentId.
   *
   * @param commentId id of Comment to remove
   * @return removed Comment or null if one was not found with the id
   */
  public Comment removeComment(final long commentId) {
    Comment removedComment = null;

    if (comments != null) {
      for (int index = comments.size() - 1; index >= 0; --index) {
        Comment currentComment = comments.get(index);

        if (currentComment.getId() == commentId) {
          removedComment = comments.remove(index);
          break;
        }
      }
    }

    return removedComment;
  }
예제 #4
0
파일: Comment.java 프로젝트: fly10000/zcms
 /** Copies the contents of the specified bean into this bean. */
 public void copy(Comment that) {
   setId(that.getId());
   setContent(that.getContent());
   setReleaseDate(that.getReleaseDate());
   setArticleId(that.getArticleId());
   setUserId(that.getUserId());
   setState(that.getState());
   setSysDate(that.getSysDate());
   setCheckState(that.getCheckState());
 }
예제 #5
0
파일: Post.java 프로젝트: chrde/toys
 public void addComment(Comment comment) {
   comments.add(comment);
   comment.setPost(this);
 }
예제 #6
0
파일: Posting.java 프로젝트: jhooni3/yobi
 /**
  * @return
  * @see models.AbstractPosting#getComments()
  */
 @Transient
 public List<? extends Comment> getComments() {
   Collections.sort(comments, Comment.comparator());
   return comments;
 }