]> git.mxchange.org Git - jcontacts-core.git/blobdiff - src/org/mxchange/jcontacts/contact/Contact.java
rewrote to use unique proptery to avoid another @Index (lesser code)
[jcontacts-core.git] / src / org / mxchange / jcontacts / contact / Contact.java
index 6c1f583c22594b4fbc8e228afdc8caf0499f0532..0832aedf3b6589e21c960c902cc03e015d6b4705 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -20,9 +20,13 @@ import java.io.Serializable;
 import java.util.Calendar;
 import java.util.Date;
 import org.mxchange.jcontacts.contact.gender.Gender;
+import org.mxchange.jcountry.data.Country;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
 
 /**
- * A general contact interface
+ * A general contact POJI
  * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
@@ -33,271 +37,284 @@ public interface Contact extends Serializable {
         * <p>
         * @param contact Source instance
         */
-       public void copyAll (final Contact contact);
+       void copyAll (final Contact contact);
 
        /**
         * Birth day
         * <p>
         * @return the birthday
         */
-       public Date getBirthday ();
+       Date getContactBirthday ();
 
        /**
         * Birth day
         * <p>
         * @param birthday the birthday to set
         */
-       public void setBirthday (final Date birthday);
+       void setContactBirthday (final Date birthday);
 
        /**
-        * Cellphone number
+        * Getter for cellphone number
         * <p>
-        * @return the cellphoneNumber
+        * @return Cellphone number
         */
-       public String getCellphoneNumber ();
+       DialableCellphoneNumber getContactCellphoneNumber ();
 
        /**
-        * Cellphone number
+        * Setter for cellphone number
         * <p>
-        * @param cellphoneNumber the cellphoneNumber to set
+        * @param cellphoneNumber Cellphone number
         */
-       public void setCellphoneNumber (final String cellphoneNumber);
+       void setContactCellphoneNumber (final DialableCellphoneNumber cellphoneNumber);
 
        /**
         * City
         * <p>
         * @return the city
         */
-       public String getCity ();
+       String getContactCity ();
 
        /**
         * City
         * <p>
         * @param city the city to set
         */
-       public void setCity (final String city);
+       void setContactCity (final String city);
 
        /**
         * Comments
         * <p>
         * @return the comment
         */
-       public String getComment ();
+       String getContactComment ();
 
        /**
         * Comments
         * <p>
         * @param comment the comment to set
         */
-       public void setComment (final String comment);
-
-       /**
-        * Company name
-        * <p>
-        * @return the companyName
-        */
-       public String getCompanyName ();
-
-       /**
-        * Company name
-        * <p>
-        * @param companyName the companyName to set
-        */
-       public void setCompanyName (final String companyName);
+       void setContactComment (final String comment);
 
        /**
         * Id number
         * <p>
         * @return the contactId
         */
-       public Long getContactId ();
+       Long getContactId ();
 
        /**
         * Id number
         * <p>
         * @param id the contactId to set
         */
-       public void setContactId (final Long id);
+       void setContactId (final Long id);
 
        /**
         * Country code
         * <p>
         * @return the countryCode
         */
-       public String getCountryCode ();
+       Country getContactCountry ();
 
        /**
         * Country code
         * <p>
-        * @param countryCode the countryCode to set
+        * @param contactCountry the countryCode to set
         */
-       public void setCountryCode (final String countryCode);
+       void setContactCountry (final Country contactCountry);
 
        /**
         * Getter for "created" timestamp
         * <p>
         * @return "created" timestamp
         */
-       public Calendar getCreated ();
+       Calendar getContactCreated ();
 
        /**
         * Setter for "created" timestamp
         * <p>
         * @param created "created" timestamp
         */
-       public void setCreated (final Calendar created);
+       void setContactCreated (final Calendar created);
 
        /**
         * Email address
         * <p>
         * @return the emailAddress
         */
-       public String getEmailAddress ();
+       String getContactEmailAddress ();
 
        /**
         * Email address
         * <p>
         * @param emailAddress the emailAddress to set
         */
-       public void setEmailAddress (final String emailAddress);
+       void setContactEmailAddress (final String emailAddress);
 
        /**
         * Family name
         * <p>
         * @return the familyName
         */
-       public String getFamilyName ();
+       String getContactFamilyName ();
 
        /**
         * Family name
         * <p>
         * @param familyName the familyName to set
         */
-       public void setFamilyName (final String familyName);
+       void setContactFamilyName (final String familyName);
 
        /**
         * Fax number
         * <p>
         * @return the faxNumber
         */
-       public String getFaxNumber ();
+       DialableFaxNumber getContactFaxNumber ();
 
        /**
         * Fax number
         * <p>
         * @param faxNumber the faxNumber to set
         */
-       public void setFaxNumber (final String faxNumber);
+       void setContactFaxNumber (final DialableFaxNumber faxNumber);
 
        /**
         * First name
         * <p>
         * @return the first name
         */
-       public String getFirstName ();
+       String getContactFirstName ();
 
        /**
         * First name
         * <p>
         * @param firstName the first name to set
         */
-       public void setFirstName (final String firstName);
+       void setContactFirstName (final String firstName);
 
        /**
         * Gender of the contact
         * <p>
         * @return the gender
         */
-       public Gender getGender ();
+       Gender getContactGender ();
 
        /**
         * Gender of the contact
         * <p>
         * @param gender the gender to set
         */
-       public void setGender (final Gender gender);
+       void setContactGender (final Gender gender);
 
        /**
         * House number
         * <p>
         * @return the houseNumber
         */
-       public Short getHouseNumber ();
+       Short getContactHouseNumber ();
 
        /**
         * House number
         * <p>
         * @param houseNumber the houseNumber to set
         */
-       public void setHouseNumber (final Short houseNumber);
+       void setContactHouseNumber (final Short houseNumber);
 
        /**
         * Setter for own contact
         * <p>
         * @param ownContact Own contact
         */
-       public void setOwnContact (final Boolean ownContact);
+       void setContactOwnContact (final Boolean ownContact);
 
        /**
-        * Phone number
+        * Getter for phone number
         * <p>
-        * @return the phoneNumber
+        * @return Phone number
         */
-       public String getPhoneNumber ();
+       DialableLandLineNumber getContactLandLineNumber ();
 
        /**
-        * Phone number
+        * Setter for phone number
         * <p>
-        * @param phoneNumber the phoneNumber to set
+        * @param phoneNumber Phone number
         */
-       public void setPhoneNumber (final String phoneNumber);
+       void setContactLandLineNumber (final DialableLandLineNumber phoneNumber);
 
        /**
         * Street
         * <p>
         * @return the street
         */
-       public String getStreet ();
+       String getContactStreet ();
 
        /**
         * Street
         * <p>
         * @param street the street to set
         */
-       public void setStreet (final String street);
+       void setContactStreet (final String street);
+
+       /**
+        * Getter for contact's title
+        * <p>
+        * @return Contact's title
+        */
+       String getContactTitle ();
+
+       /**
+        * Setter for contact's title
+        * <p>
+        * @param contactTitle Contact's title
+        */
+       void setContactTitle (final String contactTitle);
 
        /**
         * Getter for "updated" timestamp
         * <p>
         * @return "updated" timestamp
         */
-       public Calendar getUpdated ();
+       Calendar getContactUpdated ();
 
        /**
         * Getter for "updated" timestamp
         * <p>
         * @param updated "updated" timestamp
         */
-       public void setUpdated (final Calendar updated);
+       void setContactUpdated (final Calendar updated);
 
        /**
         * ZIP code
         * <p>
         * @return the zipCode
         */
-       public Long getZipCode ();
+       Integer getContactZipCode ();
 
        /**
         * ZIP code
         * <p>
         * @param zipCode the zipCode to set
         */
-       public void setZipCode (final Long zipCode);
+       void setContactZipCode (final Integer zipCode);
 
        /**
         * Checks whether the contact is user's own data
         * <p>
         * @return Own data?
         */
-       public Boolean isOwnContact ();
+       Boolean isOwnContact ();
+
+       /**
+        * Check if contacts are same or throw an exception
+        * <p>
+        * @param object Other possible contact class
+        * <p>
+        * @return Whether both contacts are same
+        */
+       @Override
+       boolean equals (final Object object);
+
+       @Override
+       int hashCode ();
 }