001 /*
002 * Copyright 2011 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.kfs.module.endow.businessobject;
017
018 import java.math.BigDecimal;
019 import java.sql.Date;
020 import java.util.LinkedHashMap;
021 import org.apache.commons.lang.StringUtils;
022 import org.kuali.kfs.module.endow.EndowPropertyConstants;
023 import org.kuali.kfs.sys.KFSConstants;
024 import org.kuali.rice.kns.bo.Inactivateable;
025 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
026
027 public class CashSweepModel extends PersistableBusinessObjectBase implements Inactivateable {
028
029 private Integer cashSweepModelID;
030 private String cashSweepModelName;
031 private BigDecimal sweepIncomeCashLimit;
032 private String incomeSweepInvestment;
033 private String incomeSweepRegistrationCode;
034 private BigDecimal sweepPrincipleCashLimit;
035 private String principleSweepInvestment;
036 private String principleSweepRegistrationCode;
037 private String cashSweepFrequencyCode;
038 private Date cashSweepNextDueDate;
039 private Date dateOfLastSweepModelChange;
040 private boolean active;
041
042 private PooledFundControl incomePooledFundControl;
043 private RegistrationCode incomeRegistrationCode;
044 private PooledFundControl principlePooledFundControl;
045 private RegistrationCode principleRegistrationCode;
046 private FrequencyCode cashSweepFrequencyCodeObj;
047
048 /**
049 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
050 */
051 @Override
052 protected LinkedHashMap toStringMapper() {
053 LinkedHashMap m = new LinkedHashMap();
054 m.put(EndowPropertyConstants.CASH_SWEEP_MODEL_ID, this.cashSweepModelID);
055 return m;
056 }
057
058 /**
059 * @see org.kuali.rice.kns.bo.Inactivateable#isActive()
060 */
061 public boolean isActive() {
062 return active;
063 }
064
065 /**
066 * @see org.kuali.rice.kns.bo.Inactivateable#setActive(boolean)
067 */
068 public void setActive(boolean active) {
069 this.active = active;
070 }
071
072 /**
073 * Gets the cashSweepModelID
074 *
075 * @return cashSweepModelID
076 */
077 public Integer getCashSweepModelID() {
078 return cashSweepModelID;
079 }
080 /**
081 * Sets the cashSweepModelID
082 *
083 * @param cashSweepModelID
084 */
085 public void setCashSweepModelID(Integer cashSweepModelID) {
086 this.cashSweepModelID = cashSweepModelID;
087 }
088
089 /**
090 * Gets the cashSweepModelName
091 *
092 * @return cashSweepModelName
093 */
094 public String getCashSweepModelName() {
095 return cashSweepModelName;
096 }
097 /**
098 * Sets the cashSweepModelName
099 *
100 * @param cashSweepModelName
101 */
102 public void setCashSweepModelName(String cashSweepModelName) {
103 this.cashSweepModelName = cashSweepModelName;
104 }
105
106 /**
107 * Gets the sweepIncomeCashLimit
108 *
109 * @return sweepIncomeCashLimit
110 */
111 public BigDecimal getSweepIncomeCashLimit() {
112 return sweepIncomeCashLimit;
113 }
114
115 /**
116 * Sets the sweepIncomeCashLimit
117 *
118 * @param sweepIncomeCashLimit
119 */
120 public void setSweepIncomeCashLimit(BigDecimal sweepIncomeCashLimit) {
121 this.sweepIncomeCashLimit = sweepIncomeCashLimit;
122 }
123
124 /**
125 * Gets the incomeSweepInvestment
126 *
127 * @return incomeSweepInvestment
128 */
129 public String getIncomeSweepInvestment() {
130 return incomeSweepInvestment;
131 }
132 /**
133 * Sets the incomeSweepInvestment
134 *
135 * @param incomeSweepInvestment
136 */
137 public void setIncomeSweepInvestment(String incomeSweepInvestment) {
138 this.incomeSweepInvestment = incomeSweepInvestment;
139 }
140
141 /**
142 * Gets the incomeSweepRegistrationCode
143 *
144 * @return incomeSweepRegistrationCode
145 */
146 public String getIncomeSweepRegistrationCode() {
147 return incomeSweepRegistrationCode;
148 }
149 /**
150 * Sets the incomeSweepRegistrationCode
151 *
152 * @param incomeSweepRegistrationCode
153 */
154 public void setIncomeSweepRegistrationCode(String incomeSweepRegistrationCode) {
155 this.incomeSweepRegistrationCode = incomeSweepRegistrationCode;
156 }
157
158 /**
159 * Gets the sweepPrincipleCashLimit
160 *
161 * @return sweepPrincipleCashLimit
162 */
163 public BigDecimal getSweepPrincipleCashLimit() {
164 return sweepPrincipleCashLimit;
165 }
166
167 /**
168 * Sets the sweepPrincipleCashLimit
169 *
170 * @param sweepPrincipleCashLimit
171 */
172 public void setSweepPrincipleCashLimit(BigDecimal sweepPrincipleCashLimit) {
173 this.sweepPrincipleCashLimit = sweepPrincipleCashLimit;
174 }
175
176 /**
177 * Gets the principleSweepInvestment
178 *
179 * @return principleSweepInvestment
180 */
181 public String getPrincipleSweepInvestment() {
182 return principleSweepInvestment;
183 }
184 /**
185 * Sets the principleSweepInvestment
186 *
187 * @param principleSweepInvestment
188 */
189 public void setPrincipleSweepInvestment(String principleSweepInvestment) {
190 this.principleSweepInvestment = principleSweepInvestment;
191 }
192
193 /**
194 * Gets the principleSweepRegistrationCode
195 *
196 * @return principleSweepRegistrationCode
197 */
198 public String getPrincipleSweepRegistrationCode() {
199 return principleSweepRegistrationCode;
200 }
201 /**
202 * Sets the principleSweepRegistrationCode
203 *
204 * @param principleSweepRegistrationCode
205 */
206 public void setPrincipleSweepRegistrationCode(String principleSweepRegistrationCode) {
207 this.principleSweepRegistrationCode = principleSweepRegistrationCode;
208 }
209
210 /**
211 * Gets the cashSweepNextDueDate
212 *
213 * @return cashSweepNextDueDate
214 */
215 public Date getCashSweepNextDueDate() {
216 return cashSweepNextDueDate;
217 }
218 /**
219 * Sets the cashSweepNextDueDate
220 *
221 * @param cashSweepNextDueDate
222 */
223 public void setCashSweepNextDueDate(Date cashSweepNextDueDate) {
224 this.cashSweepNextDueDate = cashSweepNextDueDate;
225 }
226
227 /**
228 * Gets the dateOfLastSweepModelChange
229 *
230 * @return dateOfLastSweepModelChange
231 */
232 public Date getDateOfLastSweepModelChange() {
233 return dateOfLastSweepModelChange;
234 }
235 /**
236 * Sets the dateOfLastSweepModelChange
237 *
238 * @param dateOfLastSweepModelChange
239 */
240 public void setDateOfLastSweepModelChange(Date dateOfLastSweepModelChange) {
241 this.dateOfLastSweepModelChange = dateOfLastSweepModelChange;
242 }
243
244 /**
245 * Gets the incomePooledFundControl
246 *
247 * @return incomePooledFundControl
248 */
249 public PooledFundControl getIncomePooledFundControl() {
250 return incomePooledFundControl;
251 }
252 /**
253 * Sets the incomePooledFundControl
254 *
255 * @param incomePooledFundControl
256 */
257 public void setIncomePooledFundControl(PooledFundControl incomePooledFundControl) {
258 this.incomePooledFundControl = incomePooledFundControl;
259 }
260
261 /**
262 * Gets the principlePooledFundControl
263 *
264 * @return principlePooledFundControl
265 */
266 public PooledFundControl getPrinciplePooledFundControl() {
267 return principlePooledFundControl;
268 }
269 /**
270 * Sets the principlePooledFundControl
271 *
272 * @param principlePooledFundControl
273 */
274 public void setPrinciplePooledFundControl(PooledFundControl principlePooledFundControl) {
275 this.principlePooledFundControl = principlePooledFundControl;
276 }
277
278 /**
279 * Gets the incomeRegistrationCode
280 *
281 * @return incomeRegistrationCode
282 */
283 public RegistrationCode getIncomeRegistrationCode() {
284 return incomeRegistrationCode;
285 }
286 /**
287 * Sets the incomeRegistrationCode
288 *
289 * @param incomeRegistrationCode
290 */
291 public void setIncomeRegistrationCode(RegistrationCode incomeRegistrationCode) {
292 this.incomeRegistrationCode = incomeRegistrationCode;
293 }
294
295 /**
296 * Gets the principleRegistrationCode
297 *
298 * @return principleRegistrationCode
299 */
300 public RegistrationCode getPrincipleRegistrationCode() {
301 return principleRegistrationCode;
302 }
303 /**
304 * Sets the principleRegistrationCode
305 *
306 * @param principleRegistrationCode
307 */
308 public void setPrincipleRegistrationCode(RegistrationCode principleRegistrationCode) {
309 this.principleRegistrationCode = principleRegistrationCode;
310 }
311
312 /**
313 * Gets the cashSweepFrequencyCode Object
314 *
315 * @return cashSweepFrequencyCodeObj
316 */
317 public FrequencyCode getCashSweepFrequencyCodeObj() {
318 return cashSweepFrequencyCodeObj;
319 }
320 /**
321 * Sets the cashSweepFrequencyCode Object
322 *
323 * @param cashSweepFrequencyCodeObj
324 */
325 public void setCashSweepFrequencyCodeObj(FrequencyCode cashSweepFrequencyCodeObj) {
326 this.cashSweepFrequencyCodeObj = cashSweepFrequencyCodeObj;
327 }
328
329 /**
330 * Gets the cashSweepFrequencyCode
331 *
332 * @return cashSweepFrequencyCode
333 */
334 public String getCashSweepFrequencyCode() {
335 return cashSweepFrequencyCode;
336 }
337 /**
338 * Sets the cashSweepFrequencyCode
339 *
340 * @param cashSweepFrequencyCode
341 */
342 public void setCashSweepFrequencyCode(String cashSweepFrequencyCode) {
343 this.cashSweepFrequencyCode = cashSweepFrequencyCode;
344 }
345
346 /**
347 * @return Returns the code and description in format: xx - xxxxxxxxxxxxxxxx
348 */
349 public String getCodeAndDescription() {
350 if (StringUtils.isEmpty(this.cashSweepModelID.toString())) {
351 return KFSConstants.EMPTY_STRING;
352 }
353 String theString = this.getCashSweepModelID().toString() + " - " + this.getCashSweepModelName();
354
355 return theString;
356 }
357 }