View Javadoc

1   /**
2    * Copyright 2004-2014 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.kpme.core.leaveplan;
17  
18  import java.sql.Time;
19  
20  import org.apache.commons.lang.StringUtils;
21  import org.kuali.kpme.core.api.leaveplan.LeavePlanContract;
22  import org.kuali.kpme.core.bo.HrBusinessObject;
23  import org.kuali.kpme.core.util.HrConstants;
24  
25  import com.google.common.collect.ImmutableList;
26  
27  public class LeavePlan extends HrBusinessObject implements LeavePlanContract {
28  	
29  	public static final String CACHE_NAME = HrConstants.CacheNamespace.NAMESPACE_PREFIX + "LeavePlan";
30  	//KPME-2273/1965 Primary Business Keys List.
31  	public static final ImmutableList<String> EQUAL_TO_FIELDS = new ImmutableList.Builder<String>()
32  	            .add("leavePlan")
33  	            .build();
34  
35  	private static final long serialVersionUID = 1L;
36  	private String lmLeavePlanId;
37  	private String leavePlan;
38  	private String descr;
39  	private String calendarYearStart;
40  	private Boolean history;
41  	private String planningMonths;
42  	private String batchPriorYearCarryOverStartDate;
43  	private Time batchPriorYearCarryOverStartTime;
44  
45  	public String getBatchPriorYearCarryOverStartDate() {
46  		return batchPriorYearCarryOverStartDate;
47  	}
48  
49  	public void setBatchPriorYearCarryOverStartDate(
50  			String batchPriorYearCarryOverStartDate) {
51  		this.batchPriorYearCarryOverStartDate = batchPriorYearCarryOverStartDate;
52  	}
53  	
54  	public Time getBatchPriorYearCarryOverStartTime() {
55  		return batchPriorYearCarryOverStartTime;
56  	}
57  
58  	public void setBatchPriorYearCarryOverStartTime(
59  			Time batchPriorYearCarryOverStartTime) {
60  		this.batchPriorYearCarryOverStartTime = batchPriorYearCarryOverStartTime;
61  	}
62  
63  	public String getPlanningMonths() {
64  		return planningMonths;
65  	}
66  
67  	public void setPlanningMonths(String planningMonths) {
68  		this.planningMonths = planningMonths;
69  	}
70  
71  	public String getLmLeavePlanId() {
72  		return lmLeavePlanId;
73  	}
74  
75  	public void setLmLeavePlanId(String lmLeavePlanId) {
76  		this.lmLeavePlanId = lmLeavePlanId;
77  	}
78  
79  	public String getLeavePlan() {
80  		return leavePlan;
81  	}
82  
83  	public void setLeavePlan(String leavePlan) {
84  		this.leavePlan = leavePlan;
85  	}
86  
87  	public String getDescr() {
88  		return descr;
89  	}
90  
91  	public void setDescr(String descr) {
92  		this.descr = descr;
93  	}
94  
95  	public String getCalendarYearStart() {
96  		return calendarYearStart;
97  	}
98  
99  	public void setCalendarYearStart(String calendarYearStart) {
100 		this.calendarYearStart = calendarYearStart;
101 	}
102 
103 	public String getCalendarYearStartMonth() {
104 		if (StringUtils.isEmpty(getCalendarYearStart())) {
105 			return "01";
106 		}
107 		String[] date = getCalendarYearStart().split("/");
108 		return date[0];
109 	}
110 
111 	public String getCalendarYearStartDayOfMonth() {
112 		if (StringUtils.isEmpty(getCalendarYearStart())) {
113 			return "01";
114 		}
115 		String[] date = getCalendarYearStart().split("/");
116 		return date[1];
117 	}
118 
119 
120 	public Boolean getHistory() {
121 		return history;
122 	}
123 
124 	public void setHistory(Boolean history) {
125 		this.history = history;
126 	}
127 
128 	@Override
129 	protected String getUniqueKey() {
130 		return leavePlan;
131 	}
132 
133 	@Override
134 	public String getId() {
135 		return getLmLeavePlanId();
136 	}
137 
138 	@Override
139 	public void setId(String id) {
140 		setLmLeavePlanId(id);
141 	}
142 
143 }