2 * Copyright (C) 2015 Roland Haeder
\r
4 * This program is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * This program is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
17 package org.mxchange.addressbook.contact;
\r
19 import org.mxchange.addressbook.BaseFrameworkSystem;
\r
24 * @author Roland Haeder
\r
28 public class BaseContact extends BaseFrameworkSystem {
\r
32 private String birthday;
\r
37 private String cellphoneNumber;
\r
42 private String city;
\r
47 private String comment;
\r
52 private String companyName;
\r
57 private String countryCode;
\r
62 private String emailAddress;
\r
67 private String familyName;
\r
72 private String faxNumber;
\r
75 * Gender code of the contact: - M = Mr. (male) - F = Mrs. (female) - C =
\r
78 private char gender;
\r
83 private int houseNumber;
\r
86 * Marker whether this contact is user's own data
\r
88 private boolean ownContact;
\r
93 private String phoneNumber;
\r
98 private String street;
\r
103 private String surname;
\r
108 private int zipCode;
\r
111 * No instances can be created of this class
\r
113 protected BaseContact () {
\r
118 * Enables the flag "own data" which signals that this contact is the user's
\r
121 public void enableFlagOwnContact () {
\r
122 this.ownContact = true;
\r
126 * Check if contacts are same or throw an exception
\r
128 * @param object Other possible contact class
\r
129 * @return Whether both contacts are same
\r
132 public boolean equals (Object object) {
\r
134 BaseContact c = (BaseContact) object;
\r
137 * Now test some data @todo Definedly needs improvement
\r
139 return ((this.getGender() == c.getGender())
\r
140 && (this.getSurname().toLowerCase().equals(c.getSurname().toLowerCase()))
\r
141 && (this.getFamilyName().toLowerCase().equals(c.getFamilyName().toLowerCase())));
\r
147 * @return the birthday
\r
149 public String getBirthday () {
\r
150 return this.birthday;
\r
156 * @param birthday the birthday to set
\r
158 public void setBirthday (final String birthday) {
\r
159 this.birthday = birthday;
\r
165 * @return the cellphoneNumber
\r
167 public String getCellphoneNumber () {
\r
168 return this.cellphoneNumber;
\r
174 * @param cellphoneNumber the cellphoneNumber to set
\r
176 public void setCellphoneNumber (final String cellphoneNumber) {
\r
177 this.cellphoneNumber = cellphoneNumber;
\r
185 public String getCity () {
\r
192 * @param city the city to set
\r
194 public void setCity (final String city) {
\r
201 * @return the comment
\r
203 public String getComment () {
\r
204 return this.comment;
\r
210 * @param comment the comment to set
\r
212 public void setComment (final String comment) {
\r
213 this.comment = comment;
\r
219 * @return the companyName
\r
221 public String getCompanyName () {
\r
222 return this.companyName;
\r
228 * @param companyName the companyName to set
\r
230 public void setCompanyName (final String companyName) {
\r
231 this.companyName = companyName;
\r
237 * @return the countryCode
\r
239 public String getCountryCode () {
\r
240 return this.countryCode;
\r
246 * @param countryCode the countryCode to set
\r
248 public void setCountryCode (final String countryCode) {
\r
249 this.countryCode = countryCode;
\r
255 * @return the emailAddress
\r
257 public String getEmailAddress () {
\r
258 return this.emailAddress;
\r
264 * @param emailAddress the emailAddress to set
\r
266 public void setEmailAddress (final String emailAddress) {
\r
267 this.emailAddress = emailAddress;
\r
273 * @return the familyName
\r
275 public String getFamilyName () {
\r
276 return this.familyName;
\r
282 * @param familyName the familyName to set
\r
284 public void setFamilyName (final String familyName) {
\r
285 this.familyName = familyName;
\r
291 * @return the faxNumber
\r
293 public String getFaxNumber () {
\r
294 return this.faxNumber;
\r
300 * @param faxNumber the faxNumber to set
\r
302 public void setFaxNumber (final String faxNumber) {
\r
303 this.faxNumber = faxNumber;
\r
307 * Gender of the contact
\r
309 * @return the gender
\r
311 public char getGender () {
\r
312 return this.gender;
\r
316 * Gender of the contact
\r
318 * @param gender the gender to set
\r
320 public void setGender (final char gender) {
\r
321 this.gender = gender;
\r
327 * @return the houseNumber
\r
329 public int getHouseNumber () {
\r
330 return this.houseNumber;
\r
336 * @param houseNumber the houseNumber to set
\r
338 public void setHouseNumber (final int houseNumber) {
\r
339 this.houseNumber = houseNumber;
\r
345 * @return the phoneNumber
\r
347 public String getPhoneNumber () {
\r
348 return this.phoneNumber;
\r
354 * @param phoneNumber the phoneNumber to set
\r
356 public void setPhoneNumber (final String phoneNumber) {
\r
357 this.phoneNumber = phoneNumber;
\r
363 * @return the street
\r
365 public String getStreet () {
\r
366 return this.street;
\r
372 * @param street the street to set
\r
374 public void setStreet (final String street) {
\r
375 this.street = street;
\r
381 * @return the surname
\r
383 public String getSurname () {
\r
384 return this.surname;
\r
390 * @param surname the surname to set
\r
392 public void setSurname (final String surname) {
\r
393 this.surname = surname;
\r
399 * @return the zipCode
\r
401 public int getZipCode () {
\r
402 return this.zipCode;
\r
408 * @param zipCode the zipCode to set
\r
410 public void setZipCode (final int zipCode) {
\r
411 this.zipCode = zipCode;
\r
415 * Checks whether the contact is user's own data
\r
417 * @return Own data?
\r
419 public boolean isOwnContact () {
\r
420 return this.ownContact;
\r