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.pizzaapplication.beans.customer;
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.contact.Gender;
25 import org.mxchange.jshop.beans.FrameworkBean;
28 * An interface for customer beans
30 * @author Roland Haeder
32 public interface CustomerBean extends FrameworkBean {
34 * Returns an iterator of all values from this object
37 * @throws java.lang.NoSuchMethodException If the invoked method was not found
38 * @throws java.lang.IllegalAccessException If the method cannot be accessed
39 * @throws java.lang.reflect.InvocationTargetException Any other problems?
41 public Iterator<Map.Entry<Field, Object>> iterator ()throws NoSuchMethodException, IllegalAccessException, InvocationTargetException;
44 * Some "getter" for translated gender of the contact
46 * @return Translated / human-readable gender
48 public String getTranslatedGender ();
51 * Gender of the contact
55 public Gender getGender ();
58 * Gender of the contact
60 * @param gender the gender to set
62 public void setGender (final Gender gender);
67 * @return the first name
69 public String getFirstName ();
74 * @param firstName the first name to set
76 public void setFirstName (final String firstName);
81 * @return the familyName
83 public String getFamilyName ();
88 * @param familyName the familyName to set
90 public void setFamilyName (final String familyName);
95 * @return the companyName
97 public String getCompanyName ();
102 * @param companyName the companyName to set
104 public void setCompanyName (final String companyName);
111 public String getStreet ();
116 * @param street the street to set
118 public void setStreet (final String street);
123 * @return the houseNumber
125 public Long getHouseNumber ();
130 * @param houseNumber the houseNumber to set
132 public void setHouseNumber (final Long houseNumber);
137 * @return the zipCode
139 public Long getZipCode ();
144 * @param zipCode the zipCode to set
146 public void setZipCode (final Long zipCode);
153 public String getCity ();
158 * @param city the city to set
160 public void setCity (final String city);
165 * @return the countryCode
167 public String getCountryCode ();
172 * @param countryCode the countryCode to set
174 public void setCountryCode (final String countryCode);
179 * @return the emailAddress
181 public String getEmailAddress ();
186 * @param emailAddress the emailAddress to set
188 public void setEmailAddress (final String emailAddress);
193 * @return the phoneNumber
195 public String getPhoneNumber ();
200 * @param phoneNumber the phoneNumber to set
202 public void setPhoneNumber (final String phoneNumber);
207 * @return the faxNumber
209 public String getFaxNumber ();
214 * @param faxNumber the faxNumber to set
216 public void setFaxNumber (final String faxNumber);
221 * @return the cellphoneNumber
223 public String getCellphoneNumber ();
228 * @param cellphoneNumber the cellphoneNumber to set
230 public void setCellphoneNumber (final String cellphoneNumber);
235 * @return the birthday
237 public String getBirthday ();
242 * @param birthday the birthday to set
244 public void setBirthday (final String birthday);
249 * @return the comment
251 public String getComment ();
256 * @param comment the comment to set
258 public void setComment (final String comment);
261 * Checks whether the contact is user's own data
265 public boolean isOwnContact ();
268 * Shows the contact to the user
270 * @param client Client instance to call back
272 public void show (final Client client);
275 * Some "getter for a value from given column name. This name will be
276 * translated into a method name and then this method is called.
278 * @param columnName Column name
279 * @return Value from field
280 * @throws IllegalArgumentException Some implementations may throw this
281 * @throws java.lang.NoSuchMethodException If the invoked method was not found
282 * @throws java.lang.IllegalAccessException If the method cannot be accessed
283 * @throws java.lang.reflect.InvocationTargetException Any other problems?
285 public Object getValueFromColumn (final String columnName) throws IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException;
288 * Some "setter" for a value from given column name. You may wish to overwrite this method in your
291 * @param columnName Column name
292 * @param value Value to set in object's field
293 * @throws IllegalArgumentException Some implementations may throw this
294 * @throws java.lang.NoSuchMethodException If the invoked method was not found
295 * @throws java.lang.IllegalAccessException If the method cannot be accessed
296 * @throws java.lang.reflect.InvocationTargetException Any other problems?
298 public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException;