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.earncodegroup;
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    public class EarnCodeGroupDefinition extends PersistableBusinessObjectBase {
024    
025            /**
026             * 
027             */
028            private static final long serialVersionUID = -8463674251885306591L;
029    
030            private String hrEarnCodeGroupDefId;
031    
032            private String earnCode;
033    
034            private String hrEarnCodeGroupId;
035    
036        private EarnCode earnCodeObj;
037    
038        // this is for the maintenance screen
039        private String earnCodeDesc;
040    
041            public String getEarnCode() {
042                    return earnCode;
043            }
044    
045            public void setEarnCode(String earnCode) {
046                    this.earnCode = earnCode;
047            }
048            
049            public String getHrEarnCodeGroupDefId() {
050                    return hrEarnCodeGroupDefId;
051            }
052    
053            public void setHrEarnCodeGroupDefId(String hrEarnCodeGroupDefId) {
054                    this.hrEarnCodeGroupDefId = hrEarnCodeGroupDefId;
055            }
056    
057            public String getHrEarnCodeGroupId() {
058                    return hrEarnCodeGroupId;
059            }
060    
061            public void setHrEarnCodeGroupId(String hrEarnCodeGroupId) {
062                    this.hrEarnCodeGroupId = hrEarnCodeGroupId;
063            }
064    
065            public void setEarnCodeDesc(String earnCodeDesc) {
066                    this.earnCodeDesc = earnCodeDesc;
067            }
068    
069            public EarnCode getEarnCodeObj() {
070                    return earnCodeObj;
071            }
072    
073            public void setEarnCodeObj(EarnCode earnCodeObj) {
074                    this.earnCodeObj = earnCodeObj;
075            }
076            
077            // this is for the maintenance screen
078            public String getEarnCodeDesc() {
079                    EarnCode earnCode = TkServiceLocator.getEarnCodeService().getEarnCode(this.earnCode, new java.sql.Date(System.currentTimeMillis()));
080                    
081                    if(earnCode != null && StringUtils.isNotBlank(earnCode.getDescription())) {
082                            return earnCode.getDescription();
083                    }
084                    return "";
085            }
086    }