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 /*
017 * Created on Oct 4, 2004
018 *
019 */
020 package org.kuali.kfs.pdp.businessobject;
021
022 import java.math.BigDecimal;
023 import java.util.Date;
024 import java.util.LinkedHashMap;
025 import java.util.List;
026
027 import org.kuali.kfs.pdp.PdpPropertyConstants;
028 import org.kuali.rice.kns.bo.TransientBusinessObjectBase;
029 import org.kuali.rice.kns.util.ErrorMap;
030 import org.kuali.rice.kns.util.KualiDecimal;
031 import org.kuali.rice.kns.util.KualiInteger;
032
033
034 /**
035 * Holds status information for a payment load.
036 */
037 public class LoadPaymentStatus extends TransientBusinessObjectBase {
038 public static enum LoadStatus {
039 SUCCESS, FAILURE
040 }
041
042 private int detailCount;
043 private KualiDecimal detailTotal;
044 private String chart;
045 private String unit;
046 private String subUnit;
047 private Date creationDate;
048 private KualiInteger batchId;
049
050 private LoadStatus loadStatus;
051 private List<String> warnings;
052 private ErrorMap errorMap;
053
054 public LoadPaymentStatus() {
055 super();
056 }
057
058 public LoadPaymentStatus(List<String> w, int d, KualiDecimal dt) {
059 warnings = w;
060 detailCount = d;
061 detailTotal = dt;
062 }
063
064 /**
065 * Gets the warnings attribute.
066 *
067 * @return Returns the warnings.
068 */
069 public List<String> getWarnings() {
070 return warnings;
071 }
072
073 /**
074 * Sets the warnings attribute value.
075 *
076 * @param warnings The warnings to set.
077 */
078 public void setWarnings(List<String> warnings) {
079 this.warnings = warnings;
080 }
081
082 /**
083 * Gets the detailCount attribute.
084 *
085 * @return Returns the detailCount.
086 */
087 public int getDetailCount() {
088 return detailCount;
089 }
090
091 /**
092 * Sets the detailCount attribute value.
093 *
094 * @param detailCount The detailCount to set.
095 */
096 public void setDetailCount(int detailCount) {
097 this.detailCount = detailCount;
098 }
099
100 /**
101 * Gets the detailTotal attribute.
102 *
103 * @return Returns the detailTotal.
104 */
105 public KualiDecimal getDetailTotal() {
106 return detailTotal;
107 }
108
109 /**
110 * Sets the detailTotal attribute value.
111 *
112 * @param detailTotal The detailTotal to set.
113 */
114 public void setDetailTotal(KualiDecimal detailTotal) {
115 this.detailTotal = detailTotal;
116 }
117
118 /**
119 * Gets the batchId attribute.
120 *
121 * @return Returns the batchId.
122 */
123 public KualiInteger getBatchId() {
124 return batchId;
125 }
126
127 /**
128 * Sets the batchId attribute value.
129 *
130 * @param batchId The batchId to set.
131 */
132 public void setBatchId(KualiInteger batchId) {
133 this.batchId = batchId;
134 }
135
136 /**
137 * Gets the loadStatus attribute.
138 *
139 * @return Returns the loadStatus.
140 */
141 public LoadStatus getLoadStatus() {
142 return loadStatus;
143 }
144
145 /**
146 * Sets the loadStatus attribute value.
147 *
148 * @param loadStatus The loadStatus to set.
149 */
150 public void setLoadStatus(LoadStatus loadStatus) {
151 this.loadStatus = loadStatus;
152 }
153
154 /**
155 * Gets the errorMap attribute.
156 *
157 * @return Returns the errorMap.
158 */
159 public ErrorMap getErrorMap() {
160 return errorMap;
161 }
162
163 /**
164 * Sets the errorMap attribute value.
165 *
166 * @param errorMap The errorMap to set.
167 */
168 public void setErrorMap(ErrorMap errorMap) {
169 this.errorMap = errorMap;
170 }
171
172 /**
173 * Gets the chart attribute.
174 *
175 * @return Returns the chart.
176 */
177 public String getChart() {
178 return chart;
179 }
180
181 /**
182 * Sets the chart attribute value.
183 *
184 * @param chart The chart to set.
185 */
186 public void setChart(String chart) {
187 this.chart = chart;
188 }
189
190 /**
191 * Gets the unit attribute.
192 *
193 * @return Returns the unit.
194 */
195 public String getUnit() {
196 return unit;
197 }
198
199 /**
200 * Sets the unit attribute value.
201 *
202 * @param unit The unit to set.
203 */
204 public void setUnit(String unit) {
205 this.unit = unit;
206 }
207
208 /**
209 * Gets the subUnit attribute.
210 *
211 * @return Returns the subUnit.
212 */
213 public String getSubUnit() {
214 return subUnit;
215 }
216
217 /**
218 * Sets the subUnit attribute value.
219 *
220 * @param subUnit The subUnit to set.
221 */
222 public void setSubUnit(String subUnit) {
223 this.subUnit = subUnit;
224 }
225
226 /**
227 * Gets the creationDate attribute.
228 *
229 * @return Returns the creationDate.
230 */
231 public Date getCreationDate() {
232 return creationDate;
233 }
234
235 /**
236 * Sets the creationDate attribute value.
237 *
238 * @param creationDate The creationDate to set.
239 */
240 public void setCreationDate(Date creationDate) {
241 this.creationDate = creationDate;
242 }
243
244 @Override
245 protected LinkedHashMap toStringMapper() {
246 LinkedHashMap m = new LinkedHashMap();
247 m.put(PdpPropertyConstants.DETAIL_COUNT, this.detailCount);
248 m.put(PdpPropertyConstants.BATCH_ID, this.batchId);
249
250 return m;
251 }
252 }