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.earncodegroup;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.hr.time.earncode.EarnCode;
20  import org.kuali.hr.time.service.base.TkServiceLocator;
21  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
22  
23  public class EarnCodeGroupDefinition extends PersistableBusinessObjectBase {
24  
25  	/**
26  	 * 
27  	 */
28  	private static final long serialVersionUID = -8463674251885306591L;
29  
30  	private String hrEarnCodeGroupDefId;
31  
32  	private String earnCode;
33  
34  	private String hrEarnCodeGroupId;
35  
36      private EarnCode earnCodeObj;
37  
38      // this is for the maintenance screen
39      private String earnCodeDesc;
40  
41  	public String getEarnCode() {
42  		return earnCode;
43  	}
44  
45  	public void setEarnCode(String earnCode) {
46  		this.earnCode = earnCode;
47  	}
48  	
49  	public String getHrEarnCodeGroupDefId() {
50  		return hrEarnCodeGroupDefId;
51  	}
52  
53  	public void setHrEarnCodeGroupDefId(String hrEarnCodeGroupDefId) {
54  		this.hrEarnCodeGroupDefId = hrEarnCodeGroupDefId;
55  	}
56  
57  	public String getHrEarnCodeGroupId() {
58  		return hrEarnCodeGroupId;
59  	}
60  
61  	public void setHrEarnCodeGroupId(String hrEarnCodeGroupId) {
62  		this.hrEarnCodeGroupId = hrEarnCodeGroupId;
63  	}
64  
65  	public void setEarnCodeDesc(String earnCodeDesc) {
66  		this.earnCodeDesc = earnCodeDesc;
67  	}
68  
69  	public EarnCode getEarnCodeObj() {
70  		return earnCodeObj;
71  	}
72  
73  	public void setEarnCodeObj(EarnCode earnCodeObj) {
74  		this.earnCodeObj = earnCodeObj;
75  	}
76  	
77  	// this is for the maintenance screen
78  	public String getEarnCodeDesc() {
79  		EarnCode earnCode = TkServiceLocator.getEarnCodeService().getEarnCode(this.earnCode, new java.sql.Date(System.currentTimeMillis()));
80  		
81  		if(earnCode != null && StringUtils.isNotBlank(earnCode.getDescription())) {
82  			return earnCode.getDescription();
83  		}
84  		return "";
85  	}
86  }