001    /**
002     * Copyright 2004-2013 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.hr.time.collection.rule;
017    
018    import org.kuali.hr.core.KPMEConstants;
019    import org.kuali.hr.time.HrBusinessObject;
020    import org.kuali.hr.time.authorization.DepartmentalRule;
021    import org.kuali.hr.time.department.Department;
022    import org.kuali.hr.time.paytype.PayType;
023    import org.kuali.hr.time.workarea.WorkArea;
024    
025    public class TimeCollectionRule extends HrBusinessObject implements DepartmentalRule {
026    
027            private static final long serialVersionUID = 7892616560736184294L;
028    
029            public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "TimeCollectionRule";
030    
031            private String tkTimeCollectionRuleId;
032            private String dept;
033            private Long workArea;
034            private boolean clockUserFl;
035            private boolean hrsDistributionF;
036            private String userPrincipalId;
037    
038            private String tkWorkAreaId;
039            private String hrDeptId;
040    
041            private Department departmentObj;
042            private WorkArea workAreaObj;
043            
044            private Boolean history;
045            
046            // chen, 11/07/11, KPME-1152
047            private String payType; 
048            private String hrPayTypeId; 
049            private PayType payTypeObj;
050            // KPME-1152
051    
052            
053            public Department getDepartmentObj() {
054                    return departmentObj;
055            }
056    
057            public String getPayType() {
058                    return payType;
059            }
060    
061            public void setPayType(String payType) {
062                    this.payType = payType;
063            }
064    
065            public String getHrPayTypeId() {
066                    return hrPayTypeId;
067            }
068    
069            public void setHrPayTypeId(String hrPayTypeId) {
070                    this.hrPayTypeId = hrPayTypeId;
071            }
072    
073            public PayType getPayTypeObj() {
074                    return payTypeObj;
075            }
076    
077            public void setPayTypeObj(PayType payTypeObj) {
078                    this.payTypeObj = payTypeObj;
079            }
080    
081            public void setDepartmentObj(Department departmentObj) {
082                    this.departmentObj = departmentObj;
083            }
084    
085            public WorkArea getWorkAreaObj() {
086                    return workAreaObj;
087            }
088    
089            public void setWorkAreaObj(WorkArea workAreaObj) {
090                    this.workAreaObj = workAreaObj;
091            }
092    
093            public Long getWorkArea() {
094                    return workArea;
095            }
096    
097            public void setWorkArea(Long workArea) {
098                    this.workArea = workArea;
099            }
100    
101            public boolean isClockUserFl() {
102                    return clockUserFl;
103            }
104    
105            public void setClockUserFl(boolean clockUserFl) {
106                    this.clockUserFl = clockUserFl;
107            }
108    
109            public boolean isHrsDistributionF() {
110                    return hrsDistributionF;
111            }
112    
113            public void setHrsDistributionF(boolean hrsDistributionF) {
114                    this.hrsDistributionF = hrsDistributionF;
115            }
116    
117            public String getUserPrincipalId() {
118                    return userPrincipalId;
119            }
120    
121            public void setUserPrincipalId(String userPrincipalId) {
122                    this.userPrincipalId = userPrincipalId;
123            }
124    
125            public String getTkTimeCollectionRuleId() {
126                    return tkTimeCollectionRuleId;
127            }
128    
129            public void setTkTimeCollectionRuleId(String tkTimeCollectionRuleId) {
130                    this.tkTimeCollectionRuleId = tkTimeCollectionRuleId;
131            }
132    
133            public String getDept() {
134                    return dept;
135            }
136    
137            public void setDept(String dept) {
138                    this.dept = dept;
139            }
140    
141            public String getTkWorkAreaId() {
142                    return tkWorkAreaId;
143            }
144    
145            public void setTkWorkAreaId(String tkWorkAreaId) {
146                    this.tkWorkAreaId = tkWorkAreaId;
147            }
148    
149            public String getHrDeptId() {
150                    return hrDeptId;
151            }
152    
153            public void setHrDeptId(String hrDeptId) {
154                    this.hrDeptId = hrDeptId;
155            }
156    
157            @Override
158            public String getUniqueKey() {
159                    String timeCollKey = getDept()+"_"+isClockUserFl()+"_"+isHrsDistributionF()+"_"+
160                    (getWorkArea() !=null ? getWorkArea().toString() : "");
161    
162                    return timeCollKey;
163            }
164    
165            @Override
166            public String getId() {
167                    return getTkTimeCollectionRuleId();
168            }
169    
170            @Override
171            public void setId(String id) {
172                    setTkTimeCollectionRuleId(id);
173            }
174    
175            public Boolean getHistory() {
176                    return history;
177            }
178    
179            public void setHistory(Boolean history) {
180                    this.history = history;
181            }
182    
183    
184    }