001/*
002 * Copyright 2006-2009 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 */
020package org.kuali.ole.module.purap.businessobject;
021
022import org.apache.commons.lang.builder.ToStringBuilder;
023
024import java.util.ArrayList;
025import java.util.HashMap;
026import java.util.List;
027import java.util.Map;
028
029public 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    /**
085     * @param addressID The addressID to set.
086     */
087    public void setAddressID(String addressID) {
088        this.addressID = addressID;
089    }
090
091    /**
092     * @return Returns the emailAddresses.
093     */
094    public Map<String, String> getEmailAddresses() {
095        return emailAddresses;
096    }
097
098    /**
099     * @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