View Javadoc

1   /**
2    * Copyright 2004-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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 org.kuali.hr.time.dept.lunch;
17  
18  import java.math.BigDecimal;
19  
20  import org.kuali.hr.core.KPMEConstants;
21  import org.kuali.hr.job.Job;
22  import org.kuali.hr.time.HrBusinessObject;
23  import org.kuali.hr.time.authorization.DepartmentalRule;
24  import org.kuali.hr.time.department.Department;
25  import org.kuali.hr.time.workarea.WorkArea;
26  import org.kuali.rice.kim.api.identity.Person;
27  
28  public class DeptLunchRule extends HrBusinessObject implements DepartmentalRule {
29      public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "DeptLunchRule";
30      private static final long serialVersionUID = 1L;
31  
32      private String tkDeptLunchRuleId;
33      private String dept;
34      private Long workArea;
35      private String principalId;
36      private Long jobNumber;    
37      private BigDecimal deductionMins;
38      private BigDecimal shiftHours;
39      private String userPrincipalId;
40  
41      private String tkWorkAreaId;
42      private String hrDeptId;
43      private String hrJobId;
44  
45      private transient WorkArea workAreaObj;
46      private transient Department departmentObj;
47      private transient Job job;
48  	private transient Person principal;
49  
50      //for lookups
51      private boolean history;
52  	
53  	public Person getPrincipal() {
54  		return principal;
55  	}
56  
57  	public void setPrincipal(Person principal) {
58  		this.principal = principal;
59  	}
60  
61  	public Job getJob() {
62  		return job;
63  	}
64  
65  
66  	public void setJob(Job job) {
67  		this.job = job;
68  	}
69  
70  
71  	public WorkArea getWorkAreaObj() {
72  		return workAreaObj;
73  	}
74  
75  
76  	public void setWorkAreaObj(WorkArea workAreaObj) {
77  		this.workAreaObj = workAreaObj;
78  	}
79  
80  
81  	public Department getDepartmentObj() {
82  		return departmentObj;
83  	}
84  
85  
86  	public void setDepartmentObj(Department departmentObj) {
87  		this.departmentObj = departmentObj;
88  	}
89  
90      public Long getWorkArea() {
91  		return workArea;
92  	}
93  
94  
95  	public void setWorkArea(Long workArea) {
96  		this.workArea = workArea;
97  	}
98  
99      public String getPrincipalId() {
100         return principalId;
101     }
102 
103 
104     public void setPrincipalId(String principalId) {
105         this.principalId = principalId;
106     }
107 
108 
109     public Long getJobNumber() {
110 		return jobNumber;
111 	}
112 
113 
114 	public void setJobNumber(Long jobNumber) {
115 		this.jobNumber = jobNumber;
116 	}
117 
118 
119 	public String getUserPrincipalId() {
120         return userPrincipalId;
121     }
122 
123 
124     public void setUserPrincipalId(String userPrincipalId) {
125         this.userPrincipalId = userPrincipalId;
126     }
127 
128 	public String getTkDeptLunchRuleId() {
129 		return tkDeptLunchRuleId;
130 	}
131 
132 
133 	public void setTkDeptLunchRuleId(String tkDeptLunchRuleId) {
134 		this.tkDeptLunchRuleId = tkDeptLunchRuleId;
135 	}
136 
137 
138 	public String getDept() {
139 		return dept;
140 	}
141 
142 
143 	public void setDept(String dept) {
144 		this.dept = dept;
145 	}
146 
147 
148 	public BigDecimal getDeductionMins() {
149 		return deductionMins;
150 	}
151 
152 
153 	public void setDeductionMins(BigDecimal deductionMins) {
154 		this.deductionMins = deductionMins;
155 	}
156 
157 
158 	public BigDecimal getShiftHours() {
159 		return shiftHours;
160 	}
161 
162 
163 	public void setShiftHours(BigDecimal shiftHours) {
164 		this.shiftHours = shiftHours;
165 	}
166 
167 	public String getTkWorkAreaId() {
168 		return tkWorkAreaId;
169 	}
170 
171 	public void setTkWorkAreaId(String tkWorkAreaId) {
172 		this.tkWorkAreaId = tkWorkAreaId;
173 	}
174 
175 	public String getHrDeptId() {
176 		return hrDeptId;
177 	}
178 
179 	public void setHrDeptId(String hrDeptId) {
180 		this.hrDeptId = hrDeptId;
181 	}
182 
183 	public String getHrJobId() {
184 		return hrJobId;
185 	}
186 
187 	public void setHrJobId(String hrJobId) {
188 		this.hrJobId = hrJobId;
189 	}
190 
191 	@Override
192 	public String getUniqueKey() {
193 		return getDept() + "_" + getWorkArea() != null ? getWorkArea().toString() : "" + "_" + 
194 				getPrincipalId() + "_" + getJobNumber() != null ? getJobNumber().toString() : "";
195 	}
196 
197 	@Override
198 	public String getId() {
199 		return getTkDeptLunchRuleId();
200 	}
201 
202 	@Override
203 	public void setId(String id) {
204 		setTkDeptLunchRuleId(id);
205 	}
206 
207     public boolean isHistory() {
208         return history;
209     }
210 
211     public void setHistory(boolean history) {
212         this.history = history;
213     }
214 }