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      WorkArea workAreaObj;
46      Department departmentObj;
47      private Job job;
48  	private Person principal;
49  	
50  	public Person getPrincipal() {
51  		return principal;
52  	}
53  
54  	public void setPrincipal(Person principal) {
55  		this.principal = principal;
56  	}
57  
58  	public Job getJob() {
59  		return job;
60  	}
61  
62  
63  	public void setJob(Job job) {
64  		this.job = job;
65  	}
66  
67  
68  	public WorkArea getWorkAreaObj() {
69  		return workAreaObj;
70  	}
71  
72  
73  	public void setWorkAreaObj(WorkArea workAreaObj) {
74  		this.workAreaObj = workAreaObj;
75  	}
76  
77  
78  	public Department getDepartmentObj() {
79  		return departmentObj;
80  	}
81  
82  
83  	public void setDepartmentObj(Department departmentObj) {
84  		this.departmentObj = departmentObj;
85  	}
86  
87      public Long getWorkArea() {
88  		return workArea;
89  	}
90  
91  
92  	public void setWorkArea(Long workArea) {
93  		this.workArea = workArea;
94  	}
95  
96      public String getPrincipalId() {
97          return principalId;
98      }
99  
100 
101     public void setPrincipalId(String principalId) {
102         this.principalId = principalId;
103     }
104 
105 
106     public Long getJobNumber() {
107 		return jobNumber;
108 	}
109 
110 
111 	public void setJobNumber(Long jobNumber) {
112 		this.jobNumber = jobNumber;
113 	}
114 
115 
116 	public String getUserPrincipalId() {
117         return userPrincipalId;
118     }
119 
120 
121     public void setUserPrincipalId(String userPrincipalId) {
122         this.userPrincipalId = userPrincipalId;
123     }
124 
125 	public String getTkDeptLunchRuleId() {
126 		return tkDeptLunchRuleId;
127 	}
128 
129 
130 	public void setTkDeptLunchRuleId(String tkDeptLunchRuleId) {
131 		this.tkDeptLunchRuleId = tkDeptLunchRuleId;
132 	}
133 
134 
135 	public String getDept() {
136 		return dept;
137 	}
138 
139 
140 	public void setDept(String dept) {
141 		this.dept = dept;
142 	}
143 
144 
145 	public BigDecimal getDeductionMins() {
146 		return deductionMins;
147 	}
148 
149 
150 	public void setDeductionMins(BigDecimal deductionMins) {
151 		this.deductionMins = deductionMins;
152 	}
153 
154 
155 	public BigDecimal getShiftHours() {
156 		return shiftHours;
157 	}
158 
159 
160 	public void setShiftHours(BigDecimal shiftHours) {
161 		this.shiftHours = shiftHours;
162 	}
163 
164 	public String getTkWorkAreaId() {
165 		return tkWorkAreaId;
166 	}
167 
168 	public void setTkWorkAreaId(String tkWorkAreaId) {
169 		this.tkWorkAreaId = tkWorkAreaId;
170 	}
171 
172 	public String getHrDeptId() {
173 		return hrDeptId;
174 	}
175 
176 	public void setHrDeptId(String hrDeptId) {
177 		this.hrDeptId = hrDeptId;
178 	}
179 
180 	public String getHrJobId() {
181 		return hrJobId;
182 	}
183 
184 	public void setHrJobId(String hrJobId) {
185 		this.hrJobId = hrJobId;
186 	}
187 
188 	@Override
189 	public String getUniqueKey() {
190 		return getDept() + "_" + getWorkArea() != null ? getWorkArea().toString() : "" + "_" + 
191 				getPrincipalId() + "_" + getJobNumber() != null ? getJobNumber().toString() : "";
192 	}
193 
194 	@Override
195 	public String getId() {
196 		return getTkDeptLunchRuleId();
197 	}
198 
199 	@Override
200 	public void setId(String id) {
201 		setTkDeptLunchRuleId(id);
202 	}
203 }