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 public static final String CACHE_NAME = KPMEConstants.APPLICATION_NAMESPACE_CODE + "/" + "TimeCollectionRule"; 027 private static final long serialVersionUID = 1L; 028 029 private String tkTimeCollectionRuleId; 030 private String dept; 031 private Long workArea; 032 private boolean clockUserFl; 033 private boolean hrsDistributionF; 034 private String userPrincipalId; 035 036 private String tkWorkAreaId; 037 private String hrDeptId; 038 039 private Department departmentObj; 040 private WorkArea workAreaObj; 041 042 private Boolean history; 043 044 // chen, 11/07/11, KPME-1152 045 private String payType; 046 private String hrPayTypeId; 047 private PayType payTypeObj; 048 // KPME-1152 049 050 051 public Department getDepartmentObj() { 052 return departmentObj; 053 } 054 055 public String getPayType() { 056 return payType; 057 } 058 059 public void setPayType(String payType) { 060 this.payType = payType; 061 } 062 063 public String getHrPayTypeId() { 064 return hrPayTypeId; 065 } 066 067 public void setHrPayTypeId(String hrPayTypeId) { 068 this.hrPayTypeId = hrPayTypeId; 069 } 070 071 public PayType getPayTypeObj() { 072 return payTypeObj; 073 } 074 075 public void setPayTypeObj(PayType payTypeObj) { 076 this.payTypeObj = payTypeObj; 077 } 078 079 public void setDepartmentObj(Department departmentObj) { 080 this.departmentObj = departmentObj; 081 } 082 083 public WorkArea getWorkAreaObj() { 084 return workAreaObj; 085 } 086 087 public void setWorkAreaObj(WorkArea workAreaObj) { 088 this.workAreaObj = workAreaObj; 089 } 090 091 public Long getWorkArea() { 092 return workArea; 093 } 094 095 public void setWorkArea(Long workArea) { 096 this.workArea = workArea; 097 } 098 099 public boolean isActive() { 100 return active; 101 } 102 103 public void setActive(boolean active) { 104 this.active = active; 105 } 106 107 public boolean isClockUserFl() { 108 return clockUserFl; 109 } 110 111 public void setClockUserFl(boolean clockUserFl) { 112 this.clockUserFl = clockUserFl; 113 } 114 115 public boolean isHrsDistributionF() { 116 return hrsDistributionF; 117 } 118 119 public void setHrsDistributionF(boolean hrsDistributionF) { 120 this.hrsDistributionF = hrsDistributionF; 121 } 122 123 public String getUserPrincipalId() { 124 return userPrincipalId; 125 } 126 127 public void setUserPrincipalId(String userPrincipalId) { 128 this.userPrincipalId = userPrincipalId; 129 } 130 131 public String getTkTimeCollectionRuleId() { 132 return tkTimeCollectionRuleId; 133 } 134 135 public void setTkTimeCollectionRuleId(String tkTimeCollectionRuleId) { 136 this.tkTimeCollectionRuleId = tkTimeCollectionRuleId; 137 } 138 139 public String getDept() { 140 return dept; 141 } 142 143 public void setDept(String dept) { 144 this.dept = dept; 145 } 146 147 public String getTkWorkAreaId() { 148 return tkWorkAreaId; 149 } 150 151 public void setTkWorkAreaId(String tkWorkAreaId) { 152 this.tkWorkAreaId = tkWorkAreaId; 153 } 154 155 public String getHrDeptId() { 156 return hrDeptId; 157 } 158 159 public void setHrDeptId(String hrDeptId) { 160 this.hrDeptId = hrDeptId; 161 } 162 163 @Override 164 public String getUniqueKey() { 165 String timeCollKey = getDept()+"_"+isClockUserFl()+"_"+isHrsDistributionF()+"_"+ 166 (getWorkArea() !=null ? getWorkArea().toString() : ""); 167 168 return timeCollKey; 169 } 170 171 @Override 172 public String getId() { 173 return getTkTimeCollectionRuleId(); 174 } 175 176 @Override 177 public void setId(String id) { 178 setTkTimeCollectionRuleId(id); 179 } 180 181 public Boolean getHistory() { 182 return history; 183 } 184 185 public void setHistory(Boolean history) { 186 this.history = history; 187 } 188 189 190 }