Esempio n. 1
0
 /** 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());
 }
Esempio n. 2
0
  /**
   * 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;
  }