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     */
020    package org.sonar.wsclient.services;
021    
022    import java.util.ArrayList;
023    import java.util.Date;
024    import java.util.List;
025    
026    /**
027     * @since 2.8
028     */
029    public class Review extends Model {
030    
031      private Long id;
032      private Date createdAt = null;
033      private Date updatedAt = null;
034      private String authorLogin = null;
035      private String assigneeLogin = null;
036      private String title = null;
037      private String type = null;
038      private String status = null;
039      private String severity = null;
040      private String resourceKee = null;
041      private Integer line = null;
042      private String resolution = null;
043      private Long violationId;
044      private List<Review.Comment> comments = new ArrayList<Review.Comment>();
045    
046      /**
047       * @return id
048       */
049      public Long getId() {
050        return id;
051      }
052    
053      public Review setId(Long id) {
054        this.id = id;
055        return this;
056      }
057    
058      /**
059       * @return date of creation
060       */
061      public Date getCreatedAt() {
062        return createdAt;
063      }
064    
065      public Review setCreatedAt(Date createdAt) {
066        this.createdAt = createdAt;
067        return this;
068      }
069    
070      /**
071       * @return date of last modification
072       */
073      public Date getUpdatedAt() {
074        return updatedAt;
075      }
076    
077      public Review setUpdatedAt(Date updatedAt) {
078        this.updatedAt = updatedAt;
079        return this;
080      }
081    
082      /**
083       * @return user that initiated review
084       */
085      public String getAuthorLogin() {
086        return authorLogin;
087      }
088    
089      public Review setAuthorLogin(String s) {
090        this.authorLogin = s;
091        return this;
092      }
093    
094      /**
095       * @return assignee
096       */
097      public String getAssigneeLogin() {
098        return assigneeLogin;
099      }
100    
101      public Review setAssigneeLogin(String s) {
102        this.assigneeLogin = s;
103        return this;
104      }
105    
106      /**
107       * @return title
108       */
109      public String getTitle() {
110        return title;
111      }
112    
113      public Review setTitle(String s) {
114        this.title = s;
115        return this;
116      }
117    
118      /**
119       * @deprecated since 2.9.
120       */
121      @Deprecated
122      public String getType() {
123        return type;
124      }
125    
126      /**
127       * @deprecated since 2.9.
128       */
129      @Deprecated
130      public Review setType(String s) {
131        this.type = s;
132        return this;
133      }
134    
135      /**
136       * @return status
137       */
138      public String getStatus() {
139        return status;
140      }
141    
142      public Review setStatus(String status) {
143        this.status = status;
144        return this;
145      }
146    
147      /**
148       * @return severity
149       */
150      public String getSeverity() {
151        return severity;
152      }
153    
154      public Review setSeverity(String severity) {
155        this.severity = severity;
156        return this;
157      }
158    
159      /**
160       * @return resourceKee
161       */
162      public String getResourceKee() {
163        return resourceKee;
164      }
165    
166      public Review setResourceKee(String resourceKee) {
167        this.resourceKee = resourceKee;
168        return this;
169      }
170    
171      /**
172       * @return line
173       */
174      public Integer getLine() {
175        return line;
176      }
177    
178      public Review setLine(Integer line) {
179        this.line = line;
180        return this;
181      }
182    
183      /**
184       * @since 2.9
185       */
186      public String getResolution() {
187        return resolution;
188      }
189    
190      /**
191       * @since 2.9
192       */
193      public Review setResolution(String resolution) {
194        this.resolution = resolution;
195        return this;
196      }
197    
198      /**
199       * @since 2.9
200       * @return violation id
201       */
202      public Long getViolationId() {
203        return violationId;
204      }
205    
206      public Review setViolationId(Long violationId) {
207        this.violationId = violationId;
208        return this;
209      }
210    
211      /**
212       * @return comments
213       */
214      public List<Review.Comment> getComments() {
215        return comments;
216      }
217    
218      public Review addComments(Long id, Date updatedAt, String authorLogin, String text) {
219        this.comments.add(new Review.Comment(id, updatedAt, authorLogin, text));
220        return this;
221      }
222    
223      /**
224       * @since 2.8
225       */
226      public static final class Comment extends Model {
227    
228        private Long id = null;
229        private String authorLogin = null;
230        private Date updatedAt = null;
231        private String text = null;
232    
233        private Comment(Long id, Date updatedAt, String authorLogin, String text) {
234          this.id = id;
235          this.updatedAt = updatedAt;
236          this.authorLogin = authorLogin;
237          this.text = text;
238        }
239    
240        /**
241         * @since 2.9
242         * @return id
243         */
244        public Long getId() {
245          return id;
246        }
247    
248        /**
249         * @return user that created this comment
250         */
251        public String getAuthorLogin() {
252          return authorLogin;
253        }
254    
255        /**
256         * @return date of last modification
257         */
258        public Date getUpdatedAt() {
259          return updatedAt;
260        }
261    
262        /**
263         * @return text
264         */
265        public String getText() {
266          return text;
267        }
268      }
269    
270    }