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.shiftdiff.rule;
17  
18  import java.math.BigDecimal;
19  import java.sql.Time;
20  
21  import org.kuali.hr.core.KPMEConstants;
22  import org.kuali.hr.location.Location;
23  import org.kuali.hr.paygrade.PayGrade;
24  import org.kuali.hr.time.calendar.Calendar;
25  import org.kuali.hr.time.earncode.EarnCode;
26  import org.kuali.hr.time.earncodegroup.EarnCodeGroup;
27  import org.kuali.hr.time.rule.TkRule;
28  import org.kuali.hr.time.salgroup.SalGroup;
29  
30  public class ShiftDifferentialRule extends TkRule {
31  
32  	private static final long serialVersionUID = -3990672795815968915L;
33  
34  	public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "ShiftDifferentialRule";
35  
36  	private String tkShiftDiffRuleId;
37  	private String location;
38  	private String hrSalGroup;
39  	private String payGrade;
40  	private String earnCode;
41  	private Time beginTime;
42  	private Time endTime;
43  	private BigDecimal minHours;
44  	private boolean sunday;
45  	private boolean monday;
46  	private boolean tuesday;
47  	private boolean wednesday;
48  	private boolean thursday;
49  	private boolean friday;
50  	private boolean saturday;
51  	private String fromEarnGroup;
52  	private String pyCalendarGroup;
53  	private BigDecimal maxGap; // Gap is in HOURS
54  	private String userPrincipalId;
55  
56  	private String hrSalGroupId;
57  	private String hrLocationId;
58  	private String hrPayGradeId;	
59  	
60  	private boolean history;
61  	
62  	private EarnCode earnCodeObj;
63  	private SalGroup salGroupObj;
64      private EarnCodeGroup fromEarnGroupObj;
65      private Calendar payCalendar;
66      private Location locationObj;
67      private PayGrade payGradeObj;
68      
69  	public String getTkShiftDiffRuleId() {
70  		return tkShiftDiffRuleId;
71  	}
72  
73  	public void setTkShiftDiffRuleId(String tkShiftDiffRuleId) {
74  		this.tkShiftDiffRuleId = tkShiftDiffRuleId;
75  	}
76  
77  	public String getLocation() {
78  		return location;
79  	}
80  
81  	public void setLocation(String location) {
82  		this.location = location;
83  	}
84  
85  	public String getPayGrade() {
86  		return payGrade;
87  	}
88  
89  	public void setPayGrade(String payGrade) {
90  		this.payGrade = payGrade;
91  	}
92  
93  	public String getEarnCode() {
94  		return earnCode;
95  	}
96  
97  	public void setEarnCode(String earnCode) {
98  		this.earnCode = earnCode;
99  	}
100 
101 	public BigDecimal getMinHours() {
102 		return minHours;
103 	}
104 
105 	public void setMinHours(BigDecimal minHours) {
106 		this.minHours = minHours;
107 	}
108 
109     /**
110      * @return The maximum gap, in hours.
111      */
112 	public BigDecimal getMaxGap() {
113 		return maxGap;
114 	}
115 
116     /**
117      *
118      * @param maxGap The number of hours that can be between one time block and another for the rule to consider it part of the same shift.
119      */
120 	public void setMaxGap(BigDecimal maxGap) {
121 		this.maxGap = maxGap;
122 	}
123 
124 	public String getUserPrincipalId() {
125 		return userPrincipalId;
126 	}
127 
128 	public void setUserPrincipalId(String userPrincipalId) {
129 		this.userPrincipalId = userPrincipalId;
130 	}
131 
132 	public String getHrSalGroup() {
133 		return hrSalGroup;
134 	}
135 
136 	public void setHrSalGroup(String hrSalGroup) {
137 		this.hrSalGroup = hrSalGroup;
138 	}
139 
140 	public String getPyCalendarGroup() {
141 		return pyCalendarGroup;
142 	}
143 
144 	public void setPyCalendarGroup(String pyCalendarGroup) {
145 		this.pyCalendarGroup = pyCalendarGroup;
146 	}
147 
148 	public Time getBeginTime() {
149 		return beginTime;
150 	}
151 
152 	public void setBeginTime(Time beginTime) {
153 		this.beginTime = beginTime;
154 	}
155 
156 	public Time getEndTime() {
157 		return endTime;
158 	}
159 
160 	public void setEndTime(Time endTime) {
161 		this.endTime = endTime;
162 	}
163 
164 	public String getFromEarnGroup() {
165 		return fromEarnGroup;
166 	}
167 
168 	public void setFromEarnGroup(String fromEarnGroup) {
169 		this.fromEarnGroup = fromEarnGroup;
170 	}
171 
172 	public boolean isSunday() {
173 		return sunday;
174 	}
175 
176 	public void setSunday(boolean sunday) {
177 		this.sunday = sunday;
178 	}
179 
180 	public boolean isMonday() {
181 		return monday;
182 	}
183 
184 	public void setMonday(boolean monday) {
185 		this.monday = monday;
186 	}
187 
188 	public boolean isTuesday() {
189 		return tuesday;
190 	}
191 
192 	public void setTuesday(boolean tuesday) {
193 		this.tuesday = tuesday;
194 	}
195 
196 	public boolean isWednesday() {
197 		return wednesday;
198 	}
199 
200 	public void setWednesday(boolean wednesday) {
201 		this.wednesday = wednesday;
202 	}
203 
204 	public boolean isThursday() {
205 		return thursday;
206 	}
207 
208 	public void setThursday(boolean thursday) {
209 		this.thursday = thursday;
210 	}
211 
212 	public boolean isFriday() {
213 		return friday;
214 	}
215 
216 	public void setFriday(boolean friday) {
217 		this.friday = friday;
218 	}
219 
220 	public boolean isSaturday() {
221 		return saturday;
222 	}
223 
224 	public void setSaturday(boolean saturday) {
225 		this.saturday = saturday;
226 	}
227 
228 	public EarnCode getEarnCodeObj() {
229 		return earnCodeObj;
230 	}
231 
232 	public void setEarnCodeObj(EarnCode earnCodeObj) {
233 		this.earnCodeObj = earnCodeObj;
234 	}
235 
236 	public SalGroup getSalGroupObj() {
237 		return salGroupObj;
238 	}
239 
240 	public void setSalGroupObj(SalGroup salGroupObj) {
241 		this.salGroupObj = salGroupObj;
242 	}
243 
244     public EarnCodeGroup getFromEarnGroupObj() {
245         return fromEarnGroupObj;
246     }
247 
248     public void setFromEarnGroupObj(EarnCodeGroup fromEarnGroupObj) {
249         this.fromEarnGroupObj = fromEarnGroupObj;
250     }
251 
252     public Calendar getPayCalendar() {
253         return payCalendar;
254     }
255 
256     public void setPayCalendar(Calendar payCalendar) {
257         this.payCalendar = payCalendar;
258     }
259 
260 	public Location getLocationObj() {
261 		return locationObj;
262 	}
263 
264 	public void setLocationObj(Location locationObj) {
265 		this.locationObj = locationObj;
266 	}
267 
268 	public PayGrade getPayGradeObj() {
269 		return payGradeObj;
270 	}
271 
272 	public void setPayGradeObj(PayGrade payGradeObj) {
273 		this.payGradeObj = payGradeObj;
274 	}
275 
276 	public String getHrSalGroupId() {
277 		return hrSalGroupId;
278 	}
279 
280 	public void setHrSalGroupId(String hrSalGroupId) {
281 		this.hrSalGroupId = hrSalGroupId;
282 	}
283 
284 	public String getHrLocationId() {
285 		return hrLocationId;
286 	}
287 
288 	public void setHrLocationId(String hrLocationId) {
289 		this.hrLocationId = hrLocationId;
290 	}
291 
292 	public String getHrPayGradeId() {
293 		return hrPayGradeId;
294 	}
295 
296 	public void setHrPayGradeId(String hrPayGradeId) {
297 		this.hrPayGradeId = hrPayGradeId;
298 	}
299 
300 	@Override
301 	public String getUniqueKey() {
302 		return location + "_" + hrSalGroup + "_" + payGrade;
303 	}
304 
305 	@Override
306 	public String getId() {
307 		return getTkShiftDiffRuleId();
308 	}
309 
310 	@Override
311 	public void setId(String id) {
312 		setTkShiftDiffRuleId(id);
313 	}
314 
315 	public boolean isHistory() {
316 		return history;
317 	}
318 
319 	public void setHistory(boolean history) {
320 		this.history = history;
321 	}
322 
323 }