1 19 20 package org.lucane.applications.todolist; 21 22 import java.io.Serializable ; 23 import java.util.Date ; 24 25 public class TodolistItem implements Serializable { 26 private int id; 27 private int parentTodolistId; 28 private String name; 29 private String comment; 30 private int priority; 31 private boolean complete; 32 private Date startDate; 33 private Date endDate; 34 private Date estimatedStartDate; 35 private Date estimatedEndDate; 36 37 public static final int PRIORITY_LOW = 0; 38 public static final int PRIORITY_MEDIUM = 1; 39 public static final int PRIORITY_HIGH = 2; 40 private static String [] priorityLabels = {"low", "medium", "high"}; 41 private static String [] completeLabels = {"false", "true"}; 42 43 public TodolistItem(int parentTodolistId, String name, String comment, int priority, Date startDate, Date endDate, Date estimatedStartDate, Date estimatedEndDate) { 44 this(-1, parentTodolistId, name, comment, priority, false, startDate, endDate, estimatedStartDate, estimatedEndDate); 45 } 46 47 public TodolistItem(int parentTodolistId, String name, String comment, int priority, boolean complete, Date startDate, Date endDate, Date estimatedStartDate, Date estimatedEndDate) { 48 this(-1, parentTodolistId, name, comment, priority, complete, startDate, endDate, estimatedStartDate, estimatedEndDate); 49 } 50 51 public TodolistItem(int id, int parentTodolistId, String name, String comment, int priority, boolean complete, Date startDate, Date endDate, Date estimatedStartDate, Date estimatedEndDate) { 52 this.id = id; 53 this.parentTodolistId = parentTodolistId; 54 this.name = name; 55 this.comment = comment; 56 this.priority = priority; 57 this.startDate = startDate; 58 this.endDate = endDate; 59 this.estimatedStartDate = estimatedStartDate; 60 this.estimatedEndDate = estimatedEndDate; 61 this.complete = complete; 62 } 63 64 public int getId() { 65 return id; 66 } 67 public boolean isCompleted() { 68 return complete; 69 } 70 public String getComment() { 71 return comment; 72 } 73 public String getName() { 74 return name; 75 } 76 public int getPriority() { 77 return priority; 78 } 79 public int getParentTodolistId() { 80 return parentTodolistId; 81 } 82 83 public void setId(int i) { 84 id = i; 85 } 86 public void setComplete(boolean b) { 87 complete = b; 88 } 89 public void setComment(String string) { 90 comment = string; 91 } 92 public void setName(String string) { 93 name = string; 94 } 95 public void setPriority(int i) { 96 priority = i; 97 } 98 public void setParentTodolistId(int i) { 99 parentTodolistId = i; 100 } 101 public String toString() { 102 return getName(); 103 } 104 105 public static String [] getPriorityLabels() { 106 return priorityLabels; 107 } 108 public static void setPriorityLabels(String [] priorityLabels) { 109 TodolistItem.priorityLabels = priorityLabels; 110 } 111 112 public static String [] getCompleteLabels() { 113 return completeLabels; 114 } 115 public static void setCompleteLabels(String [] completeLabels) { 116 TodolistItem.completeLabels = completeLabels; 117 } 118 119 public Date getEndDate() { 120 return endDate; 121 } 122 public void setEndDate(Date endDate) { 123 this.endDate = endDate; 124 } 125 public Date getEstimatedEndDate() { 126 return estimatedEndDate; 127 } 128 public void setEstimatedEndDate(Date estimatedEndDate) { 129 this.estimatedEndDate = estimatedEndDate; 130 } 131 public Date getEstimatedStartDate() { 132 return estimatedStartDate; 133 } 134 public void setEstimatedStartDate(Date estimatedStartDate) { 135 this.estimatedStartDate = estimatedStartDate; 136 } 137 public Date getStartDate() { 138 return startDate; 139 } 140 public void setStartDate(Date startDate) { 141 this.startDate = startDate; 142 } 143 } 144 | Popular Tags |