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.kuali.kfs.module.endow.EndowConstants;
023 import org.kuali.kfs.module.endow.EndowPropertyConstants;
024 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
025 import org.kuali.rice.kns.util.ObjectUtils;
026
027 /**
028 * Business Object for Pooled Fund Value table.
029 */
030 public class PooledFundValue extends PersistableBusinessObjectBase {
031
032 private String pooledSecurityID;
033 private Date valueEffectiveDate;
034 private Date valuationDate;
035 private BigDecimal unitValue;
036 private BigDecimal incomeDistributionPerUnit;
037 private Date distributeIncomeOnDate;
038 private boolean incomeDistributionComplete;
039 private BigDecimal longTermGainLossDistributionPerUnit;
040 private Date distributeLongTermGainLossOnDate;
041 private boolean longTermGainLossDistributionComplete;
042 private BigDecimal shortTermGainLossDistributionPerUnit;
043 private Date distributeShortTermGainLossOnDate;
044 private boolean shortTermGainLossDistributionComplete;
045
046 private PooledFundControl pooledFundControl;
047
048 public PooledFundValue(){
049 super();
050 incomeDistributionComplete = false;
051 longTermGainLossDistributionComplete = false;
052 shortTermGainLossDistributionComplete = false;
053 }
054
055 /**
056 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
057 */
058 @Override
059 protected LinkedHashMap toStringMapper() {
060 LinkedHashMap m = new LinkedHashMap();
061 m.put(EndowPropertyConstants.POOL_SECURITY_ID, this.pooledSecurityID);
062 m.put(EndowPropertyConstants.VALUE_EFFECTIVE_DATE, this.valueEffectiveDate);
063 return m;
064 }
065
066 /**
067 * Gets the pooledSecurityID
068 *
069 * @return pooledSecurityID
070 */
071 public String getPooledSecurityID() {
072 return pooledSecurityID;
073 }
074 /**
075 * Sets the pooledSecurityID
076 *
077 * @param pooledSecurityID
078 */
079 public void setPooledSecurityID(String pooledSecurityID) {
080 this.pooledSecurityID = pooledSecurityID;
081 }
082
083
084 /**
085 * Gets the valueEffectiveDate
086 *
087 * @return valueEffectiveDate
088 */
089 public Date getValueEffectiveDate() {
090 return valueEffectiveDate;
091 }
092
093 /**
094 * Sets the valueEffectiveDate
095 *
096 * @param valueEffectiveDate
097 */
098 public void setValueEffectiveDate(Date valueEffectiveDate) {
099 this.valueEffectiveDate = valueEffectiveDate;
100 }
101
102 /**
103 * Gets the valuationDate
104 *
105 * @return valuationDate
106 */
107 public Date getValuationDate() {
108 return valuationDate;
109 }
110
111 /**
112 * Sets the valuationDate
113 *
114 * @param valuationDate
115 */
116 public void setValuationDate(Date valuationDate) {
117 this.valuationDate = valuationDate;
118 }
119
120 /**
121 * Gets the unitValue
122 *
123 * @return unitValue
124 */
125 public BigDecimal getUnitValue() {
126 return unitValue;
127 }
128
129 /**
130 * Sets the unitValue
131 *
132 * @param unitValue
133 */
134 public void setUnitValue(BigDecimal unitValue) {
135
136 if (unitValue != null) {
137 this.unitValue = unitValue.setScale(EndowConstants.Scale.SECURITY_UNIT_VALUE, BigDecimal.ROUND_HALF_UP);
138 }
139 else {
140 this.unitValue = unitValue;
141 }
142 }
143
144 /**
145 * Gets the incomeDistributionPerUnit
146 *
147 * @return incomeDistributionPerUnit
148 */
149 public BigDecimal getIncomeDistributionPerUnit() {
150 return incomeDistributionPerUnit;
151 }
152
153 /**
154 * Sets the incomeDistributionPerUnit
155 *
156 * @param incomeDistributionPerUnit
157 */
158 public void setIncomeDistributionPerUnit(BigDecimal incomeDistributionPerUnit) {
159 if (ObjectUtils.isNotNull(incomeDistributionPerUnit)){
160 this.incomeDistributionPerUnit = incomeDistributionPerUnit;
161 }
162 else
163 this.incomeDistributionPerUnit = new BigDecimal(0);
164 }
165
166 /**
167 * Gets the distributeIncomeOnDate
168 *
169 * @return distributeIncomeOnDate
170 */
171 public Date getDistributeIncomeOnDate() {
172 return distributeIncomeOnDate;
173 }
174
175 /**
176 * Sets the distributeIncomeOnDate
177 *
178 * @param distributeIncomeOnDate
179 */
180 public void setDistributeIncomeOnDate(Date distributeIncomeOnDate) {
181 this.distributeIncomeOnDate = distributeIncomeOnDate;
182 }
183
184 /**
185 * Gets the incomeDistributionComplete
186 *
187 * @return incomeDistributionComplete
188 */
189 public boolean isIncomeDistributionComplete() {
190 return incomeDistributionComplete;
191 }
192
193 /**
194 * Sets the incomeDistributionComplete
195 *
196 * @param incomeDistributionComplete
197 */
198 public void setIncomeDistributionComplete(boolean incomeDistributionComplete) {
199 this.incomeDistributionComplete = incomeDistributionComplete;
200 }
201
202 /**
203 * Gets the longTermGainLossDistributionPerUnit
204 *
205 * @return longTermGainLossDistributionPerUnit
206 */
207 public BigDecimal getLongTermGainLossDistributionPerUnit() {
208 return longTermGainLossDistributionPerUnit;
209 }
210
211 /**
212 * Sets the longTermGainLossDistributionPerUnit
213 *
214 * @param longTermGainLossDistributionPerUnit
215 */
216 public void setLongTermGainLossDistributionPerUnit(BigDecimal longTermGainLossDistributionPerUnit) {
217 if (ObjectUtils.isNotNull(longTermGainLossDistributionPerUnit)){
218 this.longTermGainLossDistributionPerUnit = longTermGainLossDistributionPerUnit;
219 }
220 else {
221 this.longTermGainLossDistributionPerUnit = new BigDecimal (0);
222 }
223 }
224
225 /**
226 * Gets the distributeLongTermGainLossOnDate
227 *
228 * @return distributeLongTermGainLossOnDate
229 */
230 public Date getDistributeLongTermGainLossOnDate() {
231 return distributeLongTermGainLossOnDate;
232 }
233
234 /**
235 * Sets the distributeLongTermGainLossOnDate
236 *
237 * @param distributeLongTermGainLossOnDate
238 */
239 public void setDistributeLongTermGainLossOnDate(Date distributeLongTermGainLossOnDate) {
240 this.distributeLongTermGainLossOnDate = distributeLongTermGainLossOnDate;
241 }
242
243 /**
244 * Gets the longTermGainLossDistributionComplete
245 *
246 * @return longTermGainLossDistributionComplete
247 */
248 public boolean isLongTermGainLossDistributionComplete() {
249 return longTermGainLossDistributionComplete;
250 }
251
252 /**
253 * Sets the longTermGainLossDistributionComplete
254 *
255 * @param longTermGainLossDistributionComplete
256 */
257 public void setLongTermGainLossDistributionComplete(boolean longTermGainLossDistributionComplete) {
258 this.longTermGainLossDistributionComplete = longTermGainLossDistributionComplete;
259 }
260
261 /**
262 * Gets the shortTermGainLossDistributionPerUnit
263 *
264 * @return shortTermGainLossDistributionPerUnit
265 */
266 public BigDecimal getShortTermGainLossDistributionPerUnit() {
267 return shortTermGainLossDistributionPerUnit;
268 }
269
270 /**
271 * Sets the shortTermGainLossDistributionPerUnit
272 *
273 * @param shortTermGainLossDistributionPerUnit
274 */
275 public void setShortTermGainLossDistributionPerUnit(BigDecimal shortTermGainLossDistributionPerUnit) {
276 if (ObjectUtils.isNotNull(shortTermGainLossDistributionPerUnit)) {
277 this.shortTermGainLossDistributionPerUnit = shortTermGainLossDistributionPerUnit;
278 }
279 else {
280 this.shortTermGainLossDistributionPerUnit = new BigDecimal(0);
281 }
282 }
283
284 /**
285 * Gets the distributeShortTermGainLossOnDate
286 *
287 * @return distributeShortTermGainLossOnDate
288 */
289 public Date getDistributeShortTermGainLossOnDate() {
290 return distributeShortTermGainLossOnDate;
291 }
292
293 /**
294 * Sets the distributeShortTermGainLossOnDate
295 *
296 * @param distributeLongTermGainLossOnDate
297 */
298 public void setDistributeShortTermGainLossOnDate(Date distributeShortTermGainLossOnDate) {
299 this.distributeShortTermGainLossOnDate = distributeShortTermGainLossOnDate;
300 }
301
302 /**
303 * Gets the shortTermGainLossDistributionComplete
304 *
305 * @return shortTermGainLossDistributionComplete
306 */
307 public boolean isShortTermGainLossDistributionComplete() {
308 return shortTermGainLossDistributionComplete;
309 }
310
311 /**
312 * Sets the shortTermGainLossDistributionComplete
313 *
314 * @param shortTermGainLossDistributionComplete
315 */
316 public void setShortTermGainLossDistributionComplete(boolean shortTermGainLossDistributionComplete) {
317 this.shortTermGainLossDistributionComplete = shortTermGainLossDistributionComplete;
318 }
319
320 /**
321 * Gets the PooledFundControl object
322 *
323 * @return pooledFundControl
324 */
325 public PooledFundControl getPooledFundControl() {
326 return pooledFundControl;
327 }
328 /**
329 * Sets the PooledFundControl object
330 *
331 * @param pooledFundControl
332 */
333 public void setPooledFundControl(PooledFundControl pooledFundControl) {
334 this.pooledFundControl = pooledFundControl;
335 }
336
337
338 }