View Javadoc
1   package org.itracker.web.ptos;
2   
3   import org.apache.commons.lang.builder.ToStringBuilder;
4   import org.itracker.model.PermissionType;
5   import org.itracker.model.Status;
6   import org.itracker.model.util.UserUtilities;
7   import org.itracker.services.ProjectService;
8   
9   import java.util.Date;
10  import java.util.Map;
11  import java.util.Set;
12  
13  public class ProjectPTO {
14  
15      private Long totalOpenIssues = null;
16      private Long totalResolvedIssues = null;
17      private Date lastUpdatedIssueDate = null;
18      private Boolean canCreate = null;
19      private Date createDate;
20      private Boolean viewable;
21      private String description;
22      private Integer id;
23      private Date modifiedDate;
24      private Status status;
25      private String name;
26  
27  
28      public ProjectPTO() {
29      }
30  
31      public Long getTotalNumberIssues() {
32          return getTotalOpenIssues() + getTotalResolvedIssues();
33      }
34  
35      public void setTotalNumberIssues(Long totalNumberIssues) {
36          setTotalOpenIssues(totalNumberIssues);
37          setTotalResolvedIssues(0l);
38      }
39  
40      public void setTotalOpenIssues(Long totalOpenIssues) {
41          this.totalOpenIssues = totalOpenIssues;
42      }
43  
44      public Long getTotalOpenIssues() {
45          return totalOpenIssues;
46      }
47  
48      public void setTotalResolvedIssues(Long totalResolvedIssues) {
49          this.totalResolvedIssues = totalResolvedIssues;
50      }
51  
52      public Long getTotalResolvedIssues() {
53          return totalResolvedIssues;
54      }
55  
56      /**
57       * @see org.itracker.model.AbstractEntity#getCreateDate()
58       */
59      public Date getCreateDate() {
60          return createDate;
61      }
62  
63      /**
64       * @see org.itracker.model.Project#getDescription()
65       */
66      public String getDescription() {
67          return description;
68      }
69  
70      /**
71       * @see org.itracker.model.AbstractEntity#getId()
72       */
73      public Integer getId() {
74          return id;
75      }
76  
77      /**
78       * @see org.itracker.model.AbstractEntity#getLastModifiedDate()
79       */
80      public Date getLastModifiedDate() {
81          return modifiedDate;
82      }
83  
84      /**
85       * @see org.itracker.model.Project#getName()
86       */
87      public String getName() {
88          return name;
89      }
90  
91      /**
92       * @see org.itracker.model.Project#getStatus()
93       */
94      public Status getStatus() {
95          return this.status;
96      }
97  
98      public Boolean getActive() {
99          return getStatus() == Status.ACTIVE;
100     }
101 
102     public Boolean isActive() {
103         return getActive();
104     }
105 
106     public Boolean getViewable() {
107         return viewable;
108     }
109 
110     public Boolean isViewable() {
111         return getViewable();
112     }
113 
114     public Boolean getCanCreate() {
115         return this.canCreate;
116     }
117 
118     public Boolean isCanCreate() {
119         return getCanCreate();
120     }
121 
122     public void setCanCreate(Boolean canCreate) {
123         this.canCreate = canCreate;
124     }
125 
126 
127     public void setLastUpdatedIssueDate(Date lastUpdatedIssueDate) {
128         this.lastUpdatedIssueDate = lastUpdatedIssueDate;
129     }
130 
131     public Date getLastUpdatedIssueDate() {
132         return lastUpdatedIssueDate;
133     }
134 
135     @Override
136     public String toString() {
137         return new ToStringBuilder(this).append(getName()).toString();
138     }
139 
140     public void setCreateDate(Date createDate) {
141         this.createDate = createDate;
142     }
143 
144     public void setViewable(Boolean viewable) {
145         this.viewable = viewable;
146     }
147 
148     public void setDescription(String description) {
149         this.description = description;
150     }
151 
152     public void setId(Integer id) {
153         this.id = id;
154     }
155 
156     public void setModifiedDate(Date modifiedDate) {
157         this.modifiedDate = modifiedDate;
158     }
159 
160     public void setStatus(Status status) {
161         this.status = status;
162     }
163 
164     public void setName(String name) {
165         this.name = name;
166     }
167 }