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.CustomerCreditMemoDetail;
024    
025    /**
026     * To group and hold the data presented to working reports of extract process
027     */
028    public class CustomerCreditMemoReportDataHolder {
029      //  private CustomerCreditMemoReportDefinition reportDefinition;
030        private Map<String, String> creditmemo;
031        private Map<String, String> invoice;
032        private Map<String, String> customer;
033        private Map<String, String> sysinfo;
034        private List<CustomerCreditMemoDetailReportDataHolder> details;
035        
036        private Map<String, Object> reportData;
037        
038        public final static String KEY_OF_CREDITMEMO_ENTRY = "creditMemo";
039        public final static String KEY_OF_INVOICE_ENTRY = "invoice";
040        public final static String KEY_OF_CUSTOMER_ENTRY = "customer";
041        public final static String KEY_OF_SYSINFO_ENTRY = "sysinfo";
042        public final static String KEY_OF_DETAILS_ENTRY = "details";
043        
044        /**
045         * Constructs a ExtractProcessReportDataHolder.java.
046         */
047        public CustomerCreditMemoReportDataHolder() {
048          //this(null);
049            
050            this.creditmemo = new HashMap<String, String>();
051            this.invoice = new HashMap<String, String>();
052            this.customer = new HashMap<String, String>();
053            this.sysinfo = new HashMap<String, String>();       
054            this.details = new ArrayList<CustomerCreditMemoDetailReportDataHolder>();
055            
056            this.reportData = new HashMap<String, Object>();
057        }
058    
059        /**
060         * Constructs a ExtractProcessReportDataHolder.java.
061         * 
062         * @param reportDefinition
063         */
064    //    public CustomerCreditMemoReportDataHolder(CustomerCreditMemoReportDefinition reportDefinition) {
065    //        super();
066    //        this.reportDefinition = reportDefinition;
067    //        this.creditmemo = new HashMap<String, String>();
068    //        this.invoice = new HashMap<String, String>();
069    //        this.customer = new HashMap<String, String>();
070    //        this.sysinfo = new HashMap<String, String>();       
071    // 
072    //        this.reportData = new HashMap<String, Object>();
073    //    }
074       
075        /**
076         * Gets the creditmemo attribute. 
077         * @return Returns the creditmemo.
078         */
079        public Map<String, String> getCreditmemo() {
080            return creditmemo;
081        }
082    
083        /**
084         * Sets the creditmemo attribute value.
085         * @param creditmemo The creditmemo to set.
086         */
087        public void setCreditmemo(Map<String, String> creditmemo) {
088            this.creditmemo = creditmemo;
089        }
090    
091        /**
092         * Gets the invoice attribute. 
093         * @return Returns the invoice.
094         */
095        public Map<String, String> getInvoice() {
096            return invoice;
097        }
098    
099        /**
100         * Sets the invoice attribute value.
101         * @param invoice The invoice to set.
102         */
103        public void setInvoice(Map<String, String> invoice) {
104            this.invoice = invoice;
105        }
106    
107        /**
108         * Gets the customer attribute. 
109         * @return Returns the customer.
110         */
111        public Map<String, String> getCustomer() {
112            return customer;
113        }
114    
115        /**
116         * Sets the customer attribute value.
117         * @param customer The customer to set.
118         */
119        public void setCustomer(Map<String, String> customer) {
120            this.customer = customer;
121        }
122    
123        /**
124         * Gets the sysinfo attribute. 
125         * @return Returns the sysinfo.
126         */
127        public Map<String, String> getSysinfo() {
128            return sysinfo;
129        }
130    
131        /**
132         * Sets the sysinfo attribute value.
133         * @param sysinfo The sysinfo to set.
134         */
135        public void setSysinfo(Map<String, String> sysinfo) {
136            this.sysinfo = sysinfo;
137        }
138    
139        
140        /**
141         * Gets the details attribute. 
142         * @return Returns the details.
143         */
144        public List<CustomerCreditMemoDetailReportDataHolder> getDetails() {
145            return details;
146        }
147    
148        /**
149         * Sets the details attribute value.
150         * @param details The details to set.
151         */
152        public void setDetails(List<CustomerCreditMemoDetailReportDataHolder> details) {
153            this.details = details;
154        }
155    
156        /**
157         * Gets the reportData attribute. 
158         * @return Returns the reportData.
159         */
160        public Map<String, Object> getReportData() {        
161            
162            reportData.put(KEY_OF_CREDITMEMO_ENTRY, creditmemo);
163            reportData.put(KEY_OF_INVOICE_ENTRY, invoice);
164            reportData.put(KEY_OF_CUSTOMER_ENTRY, customer);
165            reportData.put(KEY_OF_SYSINFO_ENTRY, sysinfo);
166            reportData.put(KEY_OF_DETAILS_ENTRY, details);
167          //  reportData.put(arg0, arg1);
168            
169            return reportData;
170        }
171        
172       
173        /**
174         * Sets the reportData attribute value.
175         * @param reportData The reportData to set.
176         */
177        public void setReportData(Map<String, Object> reportData) {
178            this.reportData = reportData;
179        }
180    
181        /**
182         * @see java.lang.Object#toString()
183         */
184        @Override
185        public String toString() {
186            return this.getReportData().toString();
187        }
188    }