2 * Copyright (C) 2015 Roland Haeder
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.jcore.contact;
19 import java.lang.reflect.Field;
20 import java.lang.reflect.InvocationTargetException;
21 import java.util.Iterator;
23 import org.mxchange.jcore.client.Client;
24 import org.mxchange.jcore.database.storage.Storable;
27 * A general contact interface
29 * @author Roland Haeder
31 public interface Contact extends Storable, Comparable<Contact> {
33 * Returns an iterator of all values from this object
36 * @throws java.lang.NoSuchMethodException If the invoked method was not found
37 * @throws java.lang.IllegalAccessException If the method cannot be accessed
38 * @throws java.lang.reflect.InvocationTargetException Any other problems?
40 public Iterator<Map.Entry<Field, Object>> iterator ()throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
43 * Some "getter" for translated gender of the contact
45 * @return Translated / human-readable gender
47 public String getTranslatedGender ();
51 * @return the contactId
53 public Long getContactId ();
57 * @param contactId the contactId to set
59 public void setContactId (final Long contactId);
62 * Gender of the contact
66 public Gender getGender ();
69 * Gender of the contact
71 * @param gender the gender to set
73 public void setGender (final Gender gender);
78 * @return the first name
80 public String getFirstName ();
85 * @param firstName the first name to set
87 public void setFirstName (final String firstName);
92 * @return the familyName
94 public String getFamilyName ();
99 * @param familyName the familyName to set
101 public void setFamilyName (final String familyName);
106 * @return the companyName
108 public String getCompanyName ();
113 * @param companyName the companyName to set
115 public void setCompanyName (final String companyName);
122 public String getStreet ();
127 * @param street the street to set
129 public void setStreet (final String street);
134 * @return the houseNumber
136 public Long getHouseNumber ();
141 * @param houseNumber the houseNumber to set
143 public void setHouseNumber (final Long houseNumber);
148 * @return the zipCode
150 public Long getZipCode ();
155 * @param zipCode the zipCode to set
157 public void setZipCode (final Long zipCode);
164 public String getCity ();
169 * @param city the city to set
171 public void setCity (final String city);
176 * @return the countryCode
178 public String getCountryCode ();
183 * @param countryCode the countryCode to set
185 public void setCountryCode (final String countryCode);
190 * @return the emailAddress
192 public String getEmailAddress ();
197 * @param emailAddress the emailAddress to set
199 public void setEmailAddress (final String emailAddress);
204 * @return the phoneNumber
206 public String getPhoneNumber ();
211 * @param phoneNumber the phoneNumber to set
213 public void setPhoneNumber (final String phoneNumber);
218 * @return the faxNumber
220 public String getFaxNumber ();
225 * @param faxNumber the faxNumber to set
227 public void setFaxNumber (final String faxNumber);
232 * @return the cellphoneNumber
234 public String getCellphoneNumber ();
239 * @param cellphoneNumber the cellphoneNumber to set
241 public void setCellphoneNumber (final String cellphoneNumber);
246 * @return the birthday
248 public String getBirthday ();
253 * @param birthday the birthday to set
255 public void setBirthday (final String birthday);
260 * @return the comment
262 public String getComment ();
267 * @param comment the comment to set
269 public void setComment (final String comment);
272 * Checks whether the contact is user's own data
276 public boolean isOwnContact ();
279 * Shows the contact to the user
281 * @param client Client instance to call back
283 public void show (final Client client);
287 * @param contact Contact to compare to
288 * @return Comparison value
291 public int compareTo (final Contact contact);