1 43 package net.jforum.entities; 44 45 import java.io.Serializable ; 46 import java.util.List ; 47 48 import net.jforum.repository.ForumRepository; 49 50 56 public class Forum implements Serializable 57 { 58 private int id; 59 private int idCategories; 60 private String name; 61 private String description; 62 private int order; 63 private int totalTopics; 64 private int totalPosts; 65 private int lastPostId; 66 private boolean moderated; 67 private boolean unread; 68 private LastPostInfo lpi; 69 private List moderatorList; 70 71 public Forum() { } 72 73 public Forum(int forumId) { 74 this.id = forumId; 75 } 76 77 public Forum(Forum f) 78 { 79 this.description = f.getDescription(); 80 this.id = f.getId(); 81 this.idCategories = f.getCategoryId(); 82 this.lastPostId = f.getLastPostId(); 83 this.moderated = f.isModerated(); 84 this.name = f.getName(); 85 this.order = f.getOrder(); 86 this.totalPosts = f.getTotalPosts(); 87 this.totalTopics = f.getTotalTopics(); 88 this.unread = f.getUnread(); 89 this.lpi = f.getLastPostInfo(); 90 this.moderatorList = f.getModeratorList(); 91 } 92 93 public void setLastPostInfo(LastPostInfo lpi) { 94 this.lpi = lpi; 95 } 96 97 public LastPostInfo getLastPostInfo() { 98 return this.lpi; 99 } 100 101 public List getModeratorList() 102 { 103 return ForumRepository.getModeratorList(this.id); 104 } 105 106 111 public String getDescription() { 112 return this.description; 113 } 114 115 120 public int getId() { 121 return this.id; 122 } 123 124 129 public int getCategoryId() { 130 return this.idCategories; 131 } 132 133 138 public int getLastPostId() { 139 return this.lastPostId; 140 } 141 142 147 public boolean isModerated() { 148 return this.moderated; 149 } 150 151 156 public String getName() { 157 return this.name; 158 } 159 160 165 public int getOrder() { 166 return this.order; 167 } 168 169 174 public int getTotalTopics() { 175 return this.totalTopics; 176 } 177 178 public boolean getUnread() { 179 return this.unread; 180 } 181 182 187 public void setDescription(String description) { 188 this.description = description; 189 } 190 191 196 public void setId(int id) { 197 this.id = id; 198 } 199 200 205 public void setIdCategories(int idCategories) { 206 this.idCategories = idCategories; 207 } 208 209 214 public void setLastPostId(int lastPostId) { 215 this.lastPostId = lastPostId; 216 } 217 218 223 public void setModerated(boolean moderated) { 224 this.moderated = moderated; 225 } 226 227 232 public void setName(String name) { 233 this.name = name; 234 } 235 236 241 public void setOrder(int order) { 242 this.order = order; 243 } 244 245 public void setUnread(boolean status) { 246 this.unread = status; 247 } 248 249 254 public void setTotalTopics(int totalTopics) { 255 this.totalTopics = totalTopics; 256 } 257 258 public int getTotalPosts() { 259 return this.totalPosts; 260 } 261 262 public void setTotalPosts(int totalPosts) { 263 this.totalPosts = totalPosts; 264 } 265 266 269 public boolean equals(Object o) 270 { 271 return ((o instanceof Forum) && (((Forum)o).getId() == this.id)); 272 } 273 274 277 public int hashCode() 278 { 279 return this.id; 280 } 281 282 285 public String toString() { 286 return "[" + this.name + ", id=" + this.id + ", order=" + this.order + "]"; 287 } 288 } 289 | Popular Tags |