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