1 package za.org.coefficient.modules.task; 2 3 import java.util.Date ; 4 5 import za.org.coefficient.util.common.DateUtil; 6 7 11 public class TaskData implements java.io.Serializable { 12 13 private Long id; private Long projectId; private String name; 16 private String description; 17 private String status; 18 private String person; 19 private Long sequence; private Date startDate; private Date estimatedEndDate; private Date actualEndDate; private Integer estimatedHours; private String projectNameField; 25 private boolean completed; 26 27 public TaskData () { 28 name = new String (); 29 description = new String (); 30 status = new String (); 31 } 32 33 40 public Long getId() { 41 return this.id; 42 } 43 44 49 public void setId(Long argId){ 50 this.id = argId; 51 this.setProjectNameField(projectId + "-" + name); 52 } 53 54 62 public Long getProjectId() { 63 return this.projectId; 64 } 65 66 71 public void setProjectId(Long argId){ 72 this.projectId = argId; 73 } 74 75 76 83 public Integer getEstimatedHours() { 84 return this.estimatedHours; 85 } 86 87 92 public void setEstimatedHours(Integer argEstimatedHours){ 93 this.estimatedHours = argEstimatedHours; 94 } 95 96 public void setEstimatedHours(String argEstimatedHours) { 97 Integer i; 98 try { 99 i = new Integer (argEstimatedHours); 100 } 101 catch ( Throwable t ) { 102 i = new Integer (0); 103 } 104 setEstimatedHours(i); 105 } 106 107 114 public Long getSequence() { 115 return this.sequence; 116 } 117 118 123 public void setSequence(Long argSequence){ 124 this.sequence = argSequence; 125 } 126 127 134 public Date getStartDate() { 135 return this.startDate; 136 } 137 138 143 public void setStartDate(Date argStartDate){ 144 this.startDate = argStartDate; 145 } 146 147 148 public void setStartDate(String year, String month, String day) { 149 startDate = DateUtil.setDate(year, month, day); 150 } 151 152 public void setEstimatedEndDate(String year, String month, String day) { 153 estimatedEndDate = DateUtil.setDate(year, month, day); 154 } 155 156 public String getStartDateAsString() { 157 return DateUtil.getDate(startDate); 158 } 159 160 public String getStartDateDay() { 161 return DateUtil.getDay(startDate); 162 } 163 164 public String getEstimatedEndDateDay() { 165 return DateUtil.getDay(estimatedEndDate); 166 } 167 168 public String getStartDateMonth() { 169 return DateUtil.getMonth(startDate); 170 } 171 public String getEstimatedEndDateMonth() { 172 return DateUtil.getMonth(estimatedEndDate); 173 } 174 public String getStartDateYear() { 175 return DateUtil.getYear(startDate); 176 } 177 public String getEstimatedEndDateYear() { 178 return DateUtil.getYear(estimatedEndDate); 179 } 180 public String getEstimatedEndDateAsString() { 181 return DateUtil.getDate(estimatedEndDate); 182 } 183 184 191 public Date getEstimatedEndDate() { 192 return this.estimatedEndDate; 193 } 194 195 200 public void setEstimatedEndDate(Date argEstimatedEndDate){ 201 this.estimatedEndDate = argEstimatedEndDate; 202 } 203 204 211 public Date getActualEndDate() { 212 return this.actualEndDate; 213 } 214 215 220 public void setActualEndDate(Date argActualEndDate){ 221 this.actualEndDate = argActualEndDate; 222 } 223 224 232 public String getName() { 233 return this.name; 234 } 235 236 241 public void setName(String name){ 242 this.name = name; 243 } 244 245 252 public String getStatus() { 253 return this.status; 254 } 255 256 261 public void setPerson(String person){ 262 this.person = person; 263 } 264 265 272 public String getPerson() { 273 return this.person; 274 } 275 276 281 public void setStatus(String status){ 282 this.status = status; 283 if (Task.FINISHED.equals(status)) { 284 completed = true; 285 } else { 286 completed = false; 287 } 288 } 289 290 298 public String getDescription() { 299 return this.description; 300 } 301 302 307 public void setDescription(String description){ 308 this.description = description; 309 } 310 311 319 public String getProjectNameField() { 320 return this.projectNameField; 321 } 322 323 328 public void setProjectNameField(String projectNameField){ 329 this.projectNameField = projectNameField; 330 } 331 332 340 public boolean getCompleted() { 341 return this.completed; 342 } 343 344 349 public void setCompleted(boolean completed){ 350 this.completed = completed; 351 } 352 353 public String dump() { 354 String st = new String ("\nID " + id + "\n" + 355 "PROJECTID " + projectId + "\n" + 356 "NAME " + name + "\n" + 357 "PERSON " + person + "\n" + 358 "DESC " + description + "\n" + 359 "START " + startDate + "\n" + 360 "ESTEND " + estimatedEndDate + "\n" + 361 "ACTEND " + actualEndDate + "\n" + 362 "HOURS " + estimatedHours + "\n" + 363 "STATUS " + status + "\n"); 364 return st; 365 } 366 367 } 368 | Popular Tags |