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
022 import org.apache.commons.lang.StringUtils;
023 import org.kuali.kfs.module.endow.EndowPropertyConstants;
024 import org.kuali.kfs.sys.KFSConstants;
025 import org.kuali.rice.kns.bo.Inactivateable;
026 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
027
028 public class AutomatedCashInvestmentModel extends PersistableBusinessObjectBase implements Inactivateable {
029
030 private Integer aciModelID;
031 private String aciModelName;
032 private String ipIndicator;
033 private String investment1SecurityID;
034 private BigDecimal investment1Percent;
035 private String investment2SecurityID;
036 private BigDecimal investment2Percent;
037 private String investment3SecurityID;
038 private BigDecimal investment3Percent;
039 private String investment4SecurityID;
040 private BigDecimal investment4Percent;
041 private String aciFrequencyCode;
042 private Date aciNextDueDate;
043 private Date dateOfLastACIModelChange;
044 private boolean active;
045
046 private PooledFundControl investment1;
047 private PooledFundControl investment2;
048 private PooledFundControl investment3;
049 private PooledFundControl investment4;
050 private FrequencyCode aciFrequencyCodeObj;
051 private IncomePrincipalIndicator ipIndicatorObj;
052
053 /**
054 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
055 */
056 @Override
057 protected LinkedHashMap toStringMapper() {
058 LinkedHashMap m = new LinkedHashMap();
059 m.put(EndowPropertyConstants.ACI_MODEL_ID, this.aciModelID);
060 return m;
061 }
062
063 /**
064 * @see org.kuali.rice.kns.bo.Inactivateable#isActive()
065 */
066 public boolean isActive() {
067 return active;
068 }
069
070 /**
071 * @see org.kuali.rice.kns.bo.Inactivateable#setActive(boolean)
072 */
073 public void setActive(boolean active) {
074 this.active = active;
075 }
076
077 /**
078 * Gets the aciModelID
079 *
080 * @return aciModelID
081 */
082 public Integer getAciModelID() {
083 return aciModelID;
084 }
085
086 /**
087 * Sets the aciModelID
088 *
089 * @param aciModelID
090 */
091 public void setAciModelID(Integer aciModelID) {
092 this.aciModelID = aciModelID;
093 }
094
095 /**
096 * Gets the aciModelName
097 *
098 * @return aciModelName
099 */
100 public String getAciModelName() {
101 return aciModelName;
102 }
103
104 /**
105 * Sets the aciModelName
106 *
107 * @param aciModelName
108 */
109 public void setAciModelName(String aciModelName) {
110 this.aciModelName = aciModelName;
111 }
112
113 /**
114 * Gets the ipIndicator
115 *
116 * @return ipIndicator
117 */
118 public String getIpIndicator() {
119 return ipIndicator;
120 }
121
122 /**
123 * Sets the ipIndicator
124 *
125 * @param ipIndicator
126 */
127 public void setIpIndicator(String ipIndicator) {
128 this.ipIndicator = ipIndicator;
129 }
130
131 /**
132 * Gets the investment1SecurityID
133 *
134 * @return investment1SecurityID
135 */
136 public String getInvestment1SecurityID() {
137 return investment1SecurityID;
138 }
139
140 /**
141 * Sets the investment1SecurityID
142 *
143 * @param investment1SecurityID
144 */
145 public void setInvestment1SecurityID(String investment1SecurityID) {
146 this.investment1SecurityID = investment1SecurityID;
147 }
148
149 /**
150 * Gets the investment1Percent
151 *
152 * @return investment1Percent
153 */
154 public BigDecimal getInvestment1Percent() {
155 return investment1Percent;
156 }
157
158 /**
159 * Sets the investment1Percent
160 *
161 * @param investment1Percent
162 */
163 public void setInvestment1Percent(BigDecimal investment1Percent) {
164 if (investment1Percent == null) {
165 investment1Percent = new BigDecimal(0.0000);
166 }
167 this.investment1Percent = investment1Percent;
168 }
169
170 /**
171 * Gets the investment2SecurityID
172 *
173 * @return investment2SecurityID
174 */
175 public String getInvestment2SecurityID() {
176 return investment2SecurityID;
177 }
178
179 /**
180 * Sets the investment2SecurityID
181 *
182 * @param investment2SecurityID
183 */
184 public void setInvestment2SecurityID(String investment2SecurityID) {
185 this.investment2SecurityID = investment2SecurityID;
186 }
187
188 /**
189 * Gets the investment2Percent
190 *
191 * @return investment2Percent
192 */
193 public BigDecimal getInvestment2Percent() {
194 return investment2Percent;
195 }
196
197 /**
198 * Sets the investment2Percent
199 *
200 * @param investment2Percent
201 */
202 public void setInvestment2Percent(BigDecimal investment2Percent) {
203 if (investment2Percent == null) {
204 investment2Percent = new BigDecimal(0.0000);
205 }
206 this.investment2Percent = investment2Percent;
207 }
208
209 /**
210 * Gets the investment3SecurityID
211 *
212 * @return investment3SecurityID
213 */
214 public String getInvestment3SecurityID() {
215 return investment3SecurityID;
216 }
217
218 /**
219 * Sets the investment3SecurityID
220 *
221 * @param investment3SecurityID
222 */
223 public void setInvestment3SecurityID(String investment3SecurityID) {
224 this.investment3SecurityID = investment3SecurityID;
225 }
226
227 /**
228 * Gets the investment3Percent
229 *
230 * @return investment3Percent
231 */
232 public BigDecimal getInvestment3Percent() {
233 return investment3Percent;
234 }
235
236 /**
237 * Sets the investment3Percent
238 *
239 * @param investment3Percent
240 */
241 public void setInvestment3Percent(BigDecimal investment3Percent) {
242 if (investment3Percent == null) {
243 investment3Percent = new BigDecimal(0.0000);
244 }
245 this.investment3Percent = investment3Percent;
246 }
247
248 /**
249 * Gets the investment4SecurityID
250 *
251 * @return investment4SecurityID
252 */
253 public String getInvestment4SecurityID() {
254 return investment4SecurityID;
255 }
256
257 /**
258 * Sets the investment4SecurityID
259 *
260 * @param investment4SecurityID
261 */
262 public void setInvestment4SecurityID(String investment4SecurityID) {
263 this.investment4SecurityID = investment4SecurityID;
264 }
265
266 /**
267 * Gets the investment4Percent
268 *
269 * @return investment4Percent
270 */
271 public BigDecimal getInvestment4Percent() {
272 return investment4Percent;
273 }
274
275 /**
276 * Sets the investment4Percent
277 *
278 * @param investment4Percent
279 */
280 public void setInvestment4Percent(BigDecimal investment4Percent) {
281 if (investment4Percent == null) {
282 investment4Percent = new BigDecimal(0.0000);
283 }
284 this.investment4Percent = investment4Percent;
285 }
286
287 /**
288 * Gets the aciFrequencyCode
289 *
290 * @return aciFrequencyCode
291 */
292 public String getAciFrequencyCode() {
293 return aciFrequencyCode;
294 }
295
296 /**
297 * Sets the aciFrequencyCode
298 *
299 * @param aciFrequencyCode
300 */
301 public void setAciFrequencyCode(String aciFrequencyCode) {
302 this.aciFrequencyCode = aciFrequencyCode;
303 }
304
305 /**
306 * Gets the aciNextDueDate
307 *
308 * @return aciNextDueDate
309 */
310 public Date getAciNextDueDate() {
311 return aciNextDueDate;
312 }
313 /**
314 * Sets the aciNextDueDate
315 *
316 * @param aciNextDueDate
317 */
318 public void setAciNextDueDate(Date aciNextDueDate) {
319 this.aciNextDueDate = aciNextDueDate;
320 }
321
322 /**
323 * Gets the dateOfLastACIModelChange
324 *
325 * @return dateOfLastACIModelChange
326 */
327 public Date getDateOfLastACIModelChange() {
328 return dateOfLastACIModelChange;
329 }
330
331 /**
332 * Sets the dateOfLastACIModelChange
333 *
334 * @param dateOfLastACIModelChange
335 */
336 public void setDateOfLastACIModelChange(Date dateOfLastACIModelChange) {
337 this.dateOfLastACIModelChange = dateOfLastACIModelChange;
338 }
339
340 /**
341 * Gets the aciFrequencyCode Object
342 *
343 * @return aciFrequencyCodeObj
344 */
345 public FrequencyCode getAciFrequencyCodeObj() {
346 return aciFrequencyCodeObj;
347 }
348
349 /**
350 * Sets the aciFrequencyCode Object
351 *
352 * @param aciFrequencyCodeObj
353 */
354 public void setAciFrequencyCodeObj(FrequencyCode aciFrequencyCodeObj) {
355 this.aciFrequencyCodeObj = aciFrequencyCodeObj;
356 }
357
358 /**
359 * Gets the investment1 Pooled Fund Control
360 *
361 * @return investment1
362 */
363 public PooledFundControl getInvestment1() {
364 return investment1;
365 }
366
367 /**
368 * Sets the investment1
369 *
370 * @param investment1 Pooled Fund Control
371 */
372 public void setInvestment1(PooledFundControl investment1) {
373 this.investment1 = investment1;
374 }
375
376 /**
377 * Gets the investment2 Pooled Fund Control
378 *
379 * @return investment2
380 */
381 public PooledFundControl getInvestment2() {
382 return investment2;
383 }
384
385 /**
386 * Sets the investment2
387 *
388 * @param investment2 Pooled Fund Control
389 */
390 public void setInvestment2(PooledFundControl investment2) {
391 this.investment2 = investment2;
392 }
393
394 /**
395 * Gets the investment3 Pooled Fund Control
396 *
397 * @return investment3
398 */
399 public PooledFundControl getInvestment3() {
400 return investment3;
401 }
402
403 /**
404 * Sets the investment3
405 *
406 * @param investment3 Pooled Fund Control
407 */
408 public void setInvestment3(PooledFundControl investment3) {
409 this.investment3 = investment3;
410 }
411
412 /**
413 * Gets the investment4 Pooled Fund Control
414 *
415 * @return investment4
416 */
417 public PooledFundControl getInvestment4() {
418 return investment4;
419 }
420
421 /**
422 * Sets the investment4
423 *
424 * @param investment4 Pooled Fund Control
425 */
426 public void setInvestment4(PooledFundControl investment4) {
427 this.investment4 = investment4;
428 }
429
430 /**
431 * Gets the ipIndicatorObj
432 *
433 * @return ipIndicatorObj
434 */
435 public IncomePrincipalIndicator getIpIndicatorObj() {
436 return ipIndicatorObj;
437 }
438
439 /**
440 * Sets the ipIndicatorObj
441 *
442 * @param ipIndicatorObj
443 */
444 public void setIpIndicatorObj(IncomePrincipalIndicator ipIndicatorObj) {
445 this.ipIndicatorObj = ipIndicatorObj;
446 }
447
448 /**
449 * @return Returns the code and description in format: xx - xxxxxxxxxxxxxxxx
450 */
451 public String getCodeAndDescription() {
452 if (StringUtils.isEmpty(this.aciModelID.toString())) {
453 return KFSConstants.EMPTY_STRING;
454 }
455 String theString = this.getAciModelID().toString() + " - " + this.getAciModelName();
456
457 return theString;
458 }
459
460 }