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.bindable.entity.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   /**
063    * Instantiates a new trade contact.
064    * 
065    * @param contactName the person first and last name
066    * @param departmentName the department name
067    * @param telephone the telephone number
068    * @param fax the fax number
069    * @param email the email
070    */
071   public Contact(String contactName, String departmentName, String telephone, String fax, String email) {
072      this.name = contactName;
073      this.department = departmentName;
074      this.telephone = telephone;
075      this.fax = fax;
076      this.email = email;
077   }
078
079   /**
080    * Gets the contact person name.
081    * 
082    * Profile:: EXTENDED
083    * 
084    * @return the person name
085    */
086   public String getName() {
087      return name;
088   }
089
090   /**
091    * Sets the contact person name.
092    * 
093    * Profile:: EXTENDED
094    * 
095    * @param name the new person name
096    * @return
097    */
098   public Contact setName(String name) {
099      this.name = name;
100      return this;
101   }
102
103   /**
104    * Gets the department name.
105    * 
106    * Profile:: EXTENDED
107    * 
108    * @return the department name
109    */
110   public String getDepartment() {
111      return department;
112   }
113
114   /**
115    * Sets the department name.
116    * 
117    * Profile:: EXTENDED
118    * 
119    * @param department the new department name
120    * @return
121    */
122   public Contact setDepartment(String department) {
123      this.department = department;
124      return this;
125   }
126
127   /**
128    * Gets the telephone number.
129    * 
130    * Profile:: EXTENDED
131    * 
132    * Example:: +{plus}49 (123) 456789-999+
133    * 
134    * @return the telephone universal communication
135    */
136   public String getTelephone() {
137      return telephone;
138   }
139
140   /**
141    * Sets the telephone number providing the string only.
142    * 
143    * Profile:: EXTENDED
144    * 
145    * Example:: +{plus}49 (123) 456789-999+
146    * 
147    * @param telephone the new telephone universal communication
148    * @return
149    */
150   public Contact setTelephone(String telephone) {
151      this.telephone = telephone;
152      return this;
153   }
154
155   /**
156    * Gets the Fax number.
157    * 
158    * Profile:: EXTENDED
159    * 
160    * Example:: +{plus}49 (123) 456789-999+
161    * 
162    * @return the Fax number
163    */
164   public String getFax() {
165      return fax;
166   }
167
168   /**
169    * Sets the telephone number providing the string only.
170    * 
171    * Profile:: EXTENDED
172    * 
173    * Example:: +{plus}49 (123) 456789-999+
174    *
175    * @param faxNumber the new fax number
176    * @return the contact
177    */
178   public Contact setFax(String faxNumber) {
179      this.fax = faxNumber;
180      return this;
181   }
182
183   /**
184    * Gets the email contacts E-mail address.
185    * 
186    * Profile:: EXTENDED
187    * 
188    * Example:: +example@konik.io+
189    * 
190    * @return the email address
191    */
192   public String getEmail() {
193      return email;
194   }
195
196   /**
197    * Sets the email contacts E-mail address.
198    * 
199    * Profile:: EXTENDED.
200    * 
201    * Example:: +example@konik.io+
202    *
203    * @param email the new email
204    * @return the contact
205    */
206   public Contact setEmail(String email) {
207      this.email = email;
208      return this;
209   }
210}