View Javadoc
1   /*
2    * Copyright 2006-2009 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  /*
17   * Created on Mar 7, 2006
18   *
19   */
20  package org.kuali.ole.module.purap.businessobject;
21  
22  import org.apache.commons.lang.builder.ToStringBuilder;
23  
24  import java.util.ArrayList;
25  import java.util.HashMap;
26  import java.util.List;
27  import java.util.Map;
28  
29  public class ElectronicInvoiceContact {
30  
31      private String role;
32      private String addressID;
33      private String name;
34      private List postalAddresses = new ArrayList();
35      private Map<String, String> emailAddresses = new HashMap<String, String>();
36      private Map<String, String> phoneNumbers = new HashMap<String, String>();
37      private Map<String, String> faxNumbers = new HashMap<String, String>();
38      private List<String> webAddresses = new ArrayList<String>();
39  
40      /**
41       *
42       */
43      public ElectronicInvoiceContact() {
44          super();
45      }
46  
47      public void addPostalAddress(ElectronicInvoicePostalAddress cpa) {
48          this.postalAddresses.add(cpa);
49      }
50  
51      public void addEmailAddress(String name, String address) {
52          this.emailAddresses.put(name, address);
53      }
54  
55      public void addPhoneNumber(String name,
56                                 String countryCode,
57                                 String cityOrAreaCode,
58                                 String number) {
59          this.phoneNumbers.put(name, countryCode + cityOrAreaCode + number);
60      }
61  
62      public void addFaxNumber(String name,
63                               String countryCode,
64                               String cityOrAreaCode,
65                               String number) {
66          this.faxNumbers.put(name, countryCode + cityOrAreaCode + number);
67      }
68  
69      public void addFaxNumber(String name, String number) {
70          this.faxNumbers.put(name, number);
71      }
72  
73      public void addWebAddress(String address) {
74          this.webAddresses.add(address);
75      }
76  
77      /**
78       * @return Returns the addressID.
79       */
80      public String getAddressID() {
81          return addressID;
82      }
83  
84      /**
85       * @param addressID The addressID to set.
86       */
87      public void setAddressID(String addressID) {
88          this.addressID = addressID;
89      }
90  
91      /**
92       * @return Returns the emailAddresses.
93       */
94      public Map<String, String> getEmailAddresses() {
95          return emailAddresses;
96      }
97  
98      /**
99       * @param emailAddresses The emailAddresses to set.
100      */
101     public void setEmailAddresses(Map emailAddresses) {
102         this.emailAddresses = emailAddresses;
103     }
104 
105     /**
106      * @return Returns the faxNumbers.
107      */
108     public Map<String, String> getFaxNumbers() {
109         return faxNumbers;
110     }
111 
112     /**
113      * @param faxNumbers The faxNumbers to set.
114      */
115     public void setFaxNumbers(Map faxNumbers) {
116         this.faxNumbers = faxNumbers;
117     }
118 
119     /**
120      * @return Returns the name.
121      */
122     public String getName() {
123         return name;
124     }
125 
126     /**
127      * @param name The name to set.
128      */
129     public void setName(String name) {
130         this.name = name;
131     }
132 
133     /**
134      * @return Returns the phoneNumbers.
135      */
136     public Map<String, String> getPhoneNumbers() {
137         return phoneNumbers;
138     }
139 
140     /**
141      * @param phoneNumbers The phoneNumbers to set.
142      */
143     public void setPhoneNumbers(Map phoneNumbers) {
144         this.phoneNumbers = phoneNumbers;
145     }
146 
147     /**
148      * @return Returns the postalAddresses.
149      */
150     public List<ElectronicInvoicePostalAddress> getPostalAddresses() {
151         return postalAddresses;
152     }
153 
154     /**
155      * @param postalAddresses The postalAddresses to set.
156      */
157     public void setPostalAddresses(List<ElectronicInvoicePostalAddress> postalAddresses) {
158         this.postalAddresses = postalAddresses;
159     }
160 
161     /**
162      * @return Returns the role.
163      */
164     public String getRole() {
165         return role;
166     }
167 
168     /**
169      * @param role The role to set.
170      */
171     public void setRole(String role) {
172         this.role = role;
173     }
174 
175     /**
176      * @return Returns the webAddresses.
177      */
178     public List<String> getWebAddresses() {
179         return webAddresses;
180     }
181 
182     /**
183      * @param webAddresses The webAddresses to set.
184      */
185     public void setWebAddresses(List webAddresses) {
186         this.webAddresses = webAddresses;
187     }
188 
189     public String toString() {
190 
191         ToStringBuilder toString = new ToStringBuilder(this);
192         toString.append("Role", getRole());
193         toString.append("Name", getName());
194         toString.append("AddressId", getAddressID());
195         toString.append("PostalAddress", getPostalAddresses());
196         toString.append("EmailAddresses", getEmailAddresses());
197         toString.append("phoneNumbers", getPhoneNumbers());
198         toString.append("FaxNumbers", getFaxNumbers());
199         toString.append("URLs", getWebAddresses());
200 
201 
202         return toString.toString();
203     }
204 }
205 
206