001 /**
002 * Copyright 2004-2012 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.earngroup;
017
018 import org.apache.commons.lang.StringUtils;
019 import org.kuali.hr.time.earncode.EarnCode;
020 import org.kuali.hr.time.service.base.TkServiceLocator;
021 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
022
023 import java.util.LinkedHashMap;
024
025 public class EarnGroupDefinition extends PersistableBusinessObjectBase {
026
027 /**
028 *
029 */
030 private static final long serialVersionUID = -8463674251885306591L;
031
032 private String hrEarnGroupDefId;
033
034 private String earnCode;
035
036 private String hrEarnGroupId;
037
038 private EarnCode earnCodeObj;
039
040 // this is for the maintenance screen
041 private String earnCodeDesc;
042
043 public String getEarnCode() {
044 return earnCode;
045 }
046
047 public void setEarnCode(String earnCode) {
048 this.earnCode = earnCode;
049 }
050
051 public String getHrEarnGroupDefId() {
052 return hrEarnGroupDefId;
053 }
054
055 public void setHrEarnGroupDefId(String hrEarnGroupDefId) {
056 this.hrEarnGroupDefId = hrEarnGroupDefId;
057 }
058
059 public String getHrEarnGroupId() {
060 return hrEarnGroupId;
061 }
062
063 public void setHrEarnGroupId(String hrEarnGroupId) {
064 this.hrEarnGroupId = hrEarnGroupId;
065 }
066
067 public EarnCode getEarnCodeObj() {
068 return earnCodeObj;
069 }
070
071 public void setEarnCodeObj(EarnCode earnCodeObj) {
072 this.earnCodeObj = earnCodeObj;
073 }
074
075 // this is for the maintenance screen
076 public String getEarnCodeDesc() {
077 EarnCode earnCode = TkServiceLocator.getEarnCodeService().getEarnCode(this.earnCode, new java.sql.Date(System.currentTimeMillis()));
078
079 if(earnCode != null && StringUtils.isNotBlank(earnCode.getDescription())) {
080 return earnCode.getDescription();
081 }
082 return "";
083 }
084 }