001/*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019 */
020package org.sonar.core.review;
021
022import org.apache.commons.lang.builder.ToStringBuilder;
023import org.apache.commons.lang.builder.ToStringStyle;
024
025import java.util.Date;
026
027/**
028 * @since 3.1
029 */
030public final class ReviewCommentDto {
031
032  private Long id;
033  private Long reviewId;
034  private Long userId;
035  private String text;
036  private Date createdAt;
037  private Date updatedAt;
038
039  public Long getId() {
040    return id;
041  }
042
043  public ReviewCommentDto setId(Long id) {
044    this.id = id;
045    return this;
046  }
047
048  public Long getUserId() {
049    return userId;
050  }
051
052  public ReviewCommentDto setUserId(Long userId) {
053    this.userId = userId;
054    return this;
055  }
056
057  public Long getReviewId() {
058    return reviewId;
059  }
060
061  public ReviewCommentDto setReviewId(Long reviewId) {
062    this.reviewId = reviewId;
063    return this;
064  }
065
066  public String getText() {
067    return text;
068  }
069
070  public ReviewCommentDto setText(String text) {
071    this.text = text;
072    return this;
073  }
074
075  public Date getCreatedAt() {
076    return createdAt;
077  }
078
079  public ReviewCommentDto setCreatedAt(Date createdAt) {
080    this.createdAt = createdAt;
081    return this;
082  }
083
084  public Date getUpdatedAt() {
085    return updatedAt;
086  }
087
088  public ReviewCommentDto setUpdatedAt(Date updatedAt) {
089    this.updatedAt = updatedAt;
090    return this;
091  }
092
093  @Override
094  public String toString() {
095    return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
096  }
097
098  @Override
099  public boolean equals(Object o) {
100    if (this == o) {
101      return true;
102    }
103    if (o == null || getClass() != o.getClass()) {
104      return false;
105    }
106
107    ReviewCommentDto reviewDto = (ReviewCommentDto) o;
108    return !(id != null ? !id.equals(reviewDto.id) : reviewDto.id != null);
109  }
110
111  @Override
112  public int hashCode() {
113    return id != null ? id.hashCode() : 0;
114  }
115}