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 Mar 7, 2006
018 *
019 */
020 package org.kuali.kfs.module.purap.businessobject;
021
022 import java.util.ArrayList;
023 import java.util.HashMap;
024 import java.util.List;
025 import java.util.Map;
026
027 import org.apache.commons.lang.builder.ToStringBuilder;
028
029 public class ElectronicInvoiceContact {
030
031 private String role;
032 private String addressID;
033 private String name;
034 private List postalAddresses = new ArrayList();
035 private Map<String,String> emailAddresses = new HashMap<String,String>();
036 private Map<String,String> phoneNumbers = new HashMap<String,String>();
037 private Map<String,String> faxNumbers = new HashMap<String,String>();
038 private List<String> webAddresses = new ArrayList<String>();
039
040 /**
041 *
042 */
043 public ElectronicInvoiceContact() {
044 super();
045 }
046
047 public void addPostalAddress(ElectronicInvoicePostalAddress cpa) {
048 this.postalAddresses.add(cpa);
049 }
050
051 public void addEmailAddress(String name,String address) {
052 this.emailAddresses.put(name, address);
053 }
054
055 public void addPhoneNumber(String name,
056 String countryCode,
057 String cityOrAreaCode,
058 String number) {
059 this.phoneNumbers.put(name, countryCode + cityOrAreaCode + number);
060 }
061
062 public void addFaxNumber(String name,
063 String countryCode,
064 String cityOrAreaCode,
065 String number) {
066 this.faxNumbers.put(name, countryCode + cityOrAreaCode + number);
067 }
068
069 public void addFaxNumber(String name,String number) {
070 this.faxNumbers.put(name, number);
071 }
072
073 public void addWebAddress(String address) {
074 this.webAddresses.add(address);
075 }
076
077 /**
078 * @return Returns the addressID.
079 */
080 public String getAddressID() {
081 return addressID;
082 }
083 /**
084 * @param addressID The addressID to set.
085 */
086 public void setAddressID(String addressID) {
087 this.addressID = addressID;
088 }
089 /**
090 * @return Returns the emailAddresses.
091 */
092 public Map<String,String> getEmailAddresses() {
093 return emailAddresses;
094 }
095 /**
096 * @param emailAddresses The emailAddresses to set.
097 */
098 public void setEmailAddresses(Map emailAddresses) {
099 this.emailAddresses = emailAddresses;
100 }
101 /**
102 * @return Returns the faxNumbers.
103 */
104 public Map<String,String> getFaxNumbers() {
105 return faxNumbers;
106 }
107 /**
108 * @param faxNumbers The faxNumbers to set.
109 */
110 public void setFaxNumbers(Map faxNumbers) {
111 this.faxNumbers = faxNumbers;
112 }
113 /**
114 * @return Returns the name.
115 */
116 public String getName() {
117 return name;
118 }
119 /**
120 * @param name The name to set.
121 */
122 public void setName(String name) {
123 this.name = name;
124 }
125 /**
126 * @return Returns the phoneNumbers.
127 */
128 public Map<String,String> getPhoneNumbers() {
129 return phoneNumbers;
130 }
131 /**
132 * @param phoneNumbers The phoneNumbers to set.
133 */
134 public void setPhoneNumbers(Map phoneNumbers) {
135 this.phoneNumbers = phoneNumbers;
136 }
137 /**
138 * @return Returns the postalAddresses.
139 */
140 public List<ElectronicInvoicePostalAddress> getPostalAddresses() {
141 return postalAddresses;
142 }
143 /**
144 * @param postalAddresses The postalAddresses to set.
145 */
146 public void setPostalAddresses(List<ElectronicInvoicePostalAddress> postalAddresses) {
147 this.postalAddresses = postalAddresses;
148 }
149 /**
150 * @return Returns the role.
151 */
152 public String getRole() {
153 return role;
154 }
155 /**
156 * @param role The role to set.
157 */
158 public void setRole(String role) {
159 this.role = role;
160 }
161 /**
162 * @return Returns the webAddresses.
163 */
164 public List<String> getWebAddresses() {
165 return webAddresses;
166 }
167 /**
168 * @param webAddresses The webAddresses to set.
169 */
170 public void setWebAddresses(List webAddresses) {
171 this.webAddresses = webAddresses;
172 }
173
174 public String toString(){
175
176 ToStringBuilder toString = new ToStringBuilder(this);
177 toString.append("Role",getRole());
178 toString.append("Name",getName());
179 toString.append("AddressId",getAddressID());
180 toString.append("PostalAddress",getPostalAddresses());
181 toString.append("EmailAddresses",getEmailAddresses());
182 toString.append("phoneNumbers",getPhoneNumbers());
183 toString.append("FaxNumbers",getFaxNumbers());
184 toString.append("URLs",getWebAddresses());
185
186
187 return toString.toString();
188 }
189 }
190
191