001/*
002 * Copyright (C) 2014 konik.io
003 *
004 * This file is part of Konik library.
005 *
006 * Konik library is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Affero General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * Konik library is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Affero General Public License for more details.
015 *
016 * You should have received a copy of the GNU Affero General Public License
017 * along with Konik library.  If not, see <http://www.gnu.org/licenses/>.
018 */
019package io.konik.zugferd.entity;
020
021import io.konik.jaxb.adapter.UniversalCommunicationAdapter;
022
023import javax.xml.bind.annotation.XmlAccessType;
024import javax.xml.bind.annotation.XmlAccessorType;
025import javax.xml.bind.annotation.XmlElement;
026import javax.xml.bind.annotation.XmlType;
027import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028
029/**
030 * = The Trade Contact
031 * 
032 * An individual with contact information.
033 */
034@XmlAccessorType(XmlAccessType.FIELD)
035@XmlType(name = "TradeContactType", propOrder = { "name", "department", "telephone", "fax", "email" })
036public class Contact {
037
038        @XmlElement(name = "PersonName")
039        private String name;
040
041        @XmlElement(name = "DepartmentName")
042        private String department;
043
044        @XmlElement(name = "TelephoneUniversalCommunication")
045        @XmlJavaTypeAdapter(value = UniversalCommunicationAdapter.class)
046        private String telephone;
047
048        @XmlElement(name = "FaxUniversalCommunication")
049        @XmlJavaTypeAdapter(value = UniversalCommunicationAdapter.class)
050        private String fax;
051
052        @XmlElement(name = "EmailURIUniversalCommunication")
053        @XmlJavaTypeAdapter(value = UniversalCommunicationAdapter.class)
054        private String email;
055
056        /**
057    * Instantiates a new contact.
058    */
059        public Contact() {}
060
061        /**
062         * Instantiates a new trade contact.
063         * 
064         * @param contactName the person first and last name
065         * @param departmentName the department name
066         * @param telephone the telephone number
067         * @param fax the fax number
068         * @param email the email
069         */
070        public Contact(String contactName, String departmentName, String telephone, String fax, String email) {
071                this.name = contactName;
072                this.department = departmentName;
073                this.telephone = telephone;
074                this.fax = fax;
075                this.email = email;
076        }
077
078        /**
079         * Gets the contact person name.
080         * 
081         * Profile:: EXTENDED
082         * 
083         * @return the person name
084         */
085        public String getName() {
086                return name;
087        }
088
089        /**
090         * Sets the contact person name.
091         * 
092         * Profile:: EXTENDED
093         * 
094         * @param name the new person name
095         * @return 
096         */
097        public Contact setName(String name) {
098                this.name = name;
099                return this;
100        }
101
102        /**
103         * Gets the department name.
104         * 
105         * Profile:: EXTENDED
106         * 
107         * @return the department name
108         */
109        public String getDepartment() {
110                return department;
111        }
112
113        /**
114         * Sets the department name.
115         * 
116         * Profile:: EXTENDED
117         * 
118         * @param department the new department name
119         * @return 
120         */
121        public Contact setDepartment(String department) {
122                this.department = department;
123                return this;
124        }
125
126        /**
127         * Gets the telephone number.
128         * 
129    * Profile:: EXTENDED
130    * 
131    * Example:: +{plus}49 (123) 456789-999+
132         * @return the telephone universal communication
133         */
134        public String getTelephone() {
135                return telephone;
136        }
137
138        /**
139         * Sets the telephone number providing the string only.
140         * 
141    * Profile:: EXTENDED
142    * 
143    * Example:: +{plus}49 (123) 456789-999+
144         * @param telephone the new telephone universal communication
145         * @return 
146         */
147        public Contact setTelephone(String telephone) {
148                this.telephone =telephone;
149                return this;
150        }
151
152        /**
153         * Gets the Fax number.
154         * 
155    * Profile:: EXTENDED
156    * 
157    * Example:: +{plus}49 (123) 456789-999+
158         * @return the Fax number
159         */
160        public String getFax() {
161                return fax;
162        }
163
164        /**
165    * Sets the telephone number providing the string only.
166    * 
167    * Profile:: EXTENDED
168    * 
169    * Example:: +{plus}49 (123) 456789-999+
170    *
171    * @param faxNumber the new fax number
172    * @return the contact
173    */
174        public Contact setFax(String faxNumber) {
175                this.fax = faxNumber;
176                return this;
177        }
178
179        /**
180    * Gets the email contacts E-mail address.
181    * 
182    * Profile:: EXTENDED
183    * 
184    * Example:: +example@konik.io+
185    * @return the email address
186    */
187        public String getEmail() {
188                return email;
189        }
190
191        /**
192    * Sets the email contacts E-mail address.
193    * 
194    * Profile:: EXTENDED.
195    * 
196    * Example:: +example@konik.io+
197    *
198    * @param email the new email
199    * @return the contact
200    */
201        public Contact setEmail(String email) {
202                this.email = email;
203                return this;
204        }
205}