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.ar.report.util;
017
018 import java.util.ArrayList;
019 import java.util.HashMap;
020 import java.util.List;
021 import java.util.Map;
022
023 import org.kuali.kfs.module.ar.businessobject.CustomerInvoiceDetail;
024 /**
025 * To group and hold the data presented to working reports of extract process
026 */
027 public class CustomerInvoiceReportDataHolder {
028
029 private Map<String, String> invoice;
030 private Map<String, String> customer;
031 private Map<String, String> sysinfo;
032 private List<CustomerInvoiceDetail> details;
033
034
035 private Map<String, Object> reportData;
036
037 public final static String KEY_OF_INVOICE_ENTRY = "invoice";
038 public final static String KEY_OF_CUSTOMER_ENTRY = "customer";
039 public final static String KEY_OF_SYSINFO_ENTRY = "sysinfo";
040 public final static String KEY_OF_DETAILS_ENTRY = "details";
041
042 /**
043 * Constructs a CustomerInvoiceReportDataHolder.java.
044 */
045 public CustomerInvoiceReportDataHolder() {
046
047 this.invoice = new HashMap<String, String>();
048 this.customer = new HashMap<String, String>();
049 this.sysinfo = new HashMap<String, String>();
050 this.details = new ArrayList<CustomerInvoiceDetail>();
051
052 this.reportData = new HashMap<String, Object>();
053 }
054
055
056 /**
057 * Gets the invoice attribute.
058 * @return Returns the invoice.
059 */
060 public Map<String, String> getInvoice() {
061 return invoice;
062 }
063
064 /**
065 * Sets the invoice attribute value.
066 * @param invoice The invoice to set.
067 */
068 public void setInvoice(Map<String, String> invoice) {
069 this.invoice = invoice;
070 }
071
072 /**
073 * Gets the customer attribute.
074 * @return Returns the customer.
075 */
076 public Map<String, String> getCustomer() {
077 return customer;
078 }
079
080 /**
081 * Sets the customer attribute value.
082 * @param customer The customer to set.
083 */
084 public void setCustomer(Map<String, String> customer) {
085 this.customer = customer;
086 }
087
088 /**
089 * Gets the sysinfo attribute.
090 * @return Returns the sysinfo.
091 */
092 public Map<String, String> getSysinfo() {
093 return sysinfo;
094 }
095
096 /**
097 * Sets the sysinfo attribute value.
098 * @param sysinfo The sysinfo to set.
099 */
100 public void setSysinfo(Map<String, String> sysinfo) {
101 this.sysinfo = sysinfo;
102 }
103
104 /**
105 * Gets the details attribute.
106 * @return Returns the details.
107 */
108 public List<CustomerInvoiceDetail> getDetails() {
109 return details;
110 }
111
112 /**
113 * Sets the details attribute value.
114 * @param details The details to set.
115 */
116 public void setDetails(List<CustomerInvoiceDetail> details) {
117 this.details = details;
118 }
119
120
121
122 /**
123 * Gets the reportData attribute.
124 * @return Returns the reportData.
125 */
126 public Map<String, Object> getReportData() {
127
128 reportData.put(KEY_OF_INVOICE_ENTRY, invoice);
129 reportData.put(KEY_OF_CUSTOMER_ENTRY, customer);
130 reportData.put(KEY_OF_SYSINFO_ENTRY, sysinfo);
131 reportData.put(KEY_OF_DETAILS_ENTRY, details);
132
133 return reportData;
134 }
135
136
137 /**
138 * Sets the reportData attribute value.
139 * @param reportData The reportData to set.
140 */
141 public void setReportData(Map<String, Object> reportData) {
142 this.reportData = reportData;
143 }
144
145 /**
146 * @see java.lang.Object#toString()
147 */
148 @Override
149 public String toString() {
150 return this.getReportData().toString();
151 }
152 }