View Javadoc

1   /*
2    * Copyright 2007 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.sf.jdigg.beans;
17  
18  import org.apache.commons.lang.builder.ToStringBuilder;
19  import org.apache.commons.lang.builder.ToStringStyle;
20  
21  /* Example:
22  <comment date="1188430876" id="8854425" story="857895"
23      up="0" down="0" replies="0" replyto="" user="GeneralJoey">
24    Bet the kid has to ride the bus.
25  </comment>
26   */
27  
28  /**
29   * A Digg comment.
30   * @author Philip May
31   * @since 1.0 M1
32   * @see <a href="http://apidoc.digg.com/ListEvents">Digg API - List Events</a>
33   */
34  public class Comment {
35  
36      private long date;
37  
38      private int id;
39  
40      /** The id of the story this comment belongs. */
41      private int story;
42  
43      private int up;
44  
45      private int down;
46  
47      private int replies;
48  
49      // TODO: activate this attribute - what's the type? It seems to be always empty.
50  //    private int replyto;
51  
52      private String user;
53  
54      private int level;
55  
56      private int root;
57  
58      /** The content of the comment. */
59      private String comment;
60  
61      public Comment() {
62      }
63  
64      public String toString() {
65          return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
66      }
67  
68      public long getDate() {
69          return date;
70      }
71  
72      public void setDate(long date) {
73          this.date = date;
74      }
75  
76      public int getId() {
77          return id;
78      }
79  
80      public void setId(int id) {
81          this.id = id;
82      }
83  
84      public int getStory() {
85          return story;
86      }
87  
88      public void setStory(int story) {
89          this.story = story;
90      }
91  
92      public int getUp() {
93          return up;
94      }
95  
96      public void setUp(int up) {
97          this.up = up;
98      }
99  
100     public int getDown() {
101         return down;
102     }
103 
104     public void setDown(int down) {
105         this.down = down;
106     }
107 
108     public int getReplies() {
109         return replies;
110     }
111 
112     public void setReplies(int replies) {
113         this.replies = replies;
114     }
115 
116     public String getUser() {
117         return user;
118     }
119 
120     public void setUser(String user) {
121         this.user = user;
122     }
123 
124     public String getComment() {
125         return comment;
126     }
127 
128     public void setComment(String comment) {
129         this.comment = comment;
130     }
131 
132     public int getLevel() {
133         return level;
134     }
135 
136     public void setLevel(int level) {
137         this.level = level;
138     }
139 
140     public int getRoot() {
141         return root;
142     }
143 
144     public void setRoot(int root) {
145         this.root = root;
146     }
147 
148 }