]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 14 Apr 2020 05:29:14 +0000 (07:29 +0200)
committerRoland Häder <roland@mxchange.org>
Tue, 14 Apr 2020 05:29:14 +0000 (07:29 +0200)
- renamed contactCreated to contactEntryCreated
- renamed contactUpdated to contactEntryUpdated

Signed-off-by: Roland Häder <roland@mxchange.org>
src/org/mxchange/jcontacts/model/contact/Contact.java
src/org/mxchange/jcontacts/model/contact/Contacts.java
src/org/mxchange/jcontacts/model/contact/UserContact.java

index c79d26a4de039ae3cd4e507ce520b4be669759ec..6d7956e4421bee5f9bc7cdaf6cf6cce800bebe39 100644 (file)
@@ -120,14 +120,28 @@ public interface Contact extends Comparable<Contact>, Serializable {
         * <p>
         * @return "created" timestamp
         */
-       Date getContactCreated ();
+       Date getContactEntryCreated ();
 
        /**
         * Setter for "created" timestamp
         * <p>
-        * @param created "created" timestamp
+        * @param contactEntryCreated "created" timestamp
         */
-       void setContactCreated (final Date created);
+       void setContactEntryCreated (final Date contactEntryCreated);
+
+       /**
+        * Getter for "updated" timestamp
+        * <p>
+        * @return "updated" timestamp
+        */
+       Date getContactEntryUpdated ();
+
+       /**
+        * Getter for "updated" timestamp
+        * <p>
+        * @param contactEntryUpdated "updated" timestamp
+        */
+       void setContactEntryUpdated (final Date contactEntryUpdated);
 
        /**
         * Email address
@@ -277,20 +291,6 @@ public interface Contact extends Comparable<Contact>, Serializable {
         */
        void setContactTitle (final String contactTitle);
 
-       /**
-        * Getter for "updated" timestamp
-        * <p>
-        * @return "updated" timestamp
-        */
-       Date getContactUpdated ();
-
-       /**
-        * Getter for "updated" timestamp
-        * <p>
-        * @param updated "updated" timestamp
-        */
-       void setContactUpdated (final Date updated);
-
        /**
         * ZIP code
         * <p>
index 645e4926ddd50f648b2ca55aba718f0ca6795460..75fd1af3a271263121be2a39b5ce1e7768dff104 100644 (file)
@@ -102,7 +102,7 @@ public class Contacts implements Serializable {
                // - other data
                targetContact.setContactBirthday(sourceContact.getContactBirthday());
                targetContact.setContactComment(sourceContact.getContactComment());
-               targetContact.setContactUpdated(sourceContact.getContactUpdated());
+               targetContact.setContactEntryUpdated(sourceContact.getContactEntryUpdated());
        }
 
        /**
@@ -179,7 +179,7 @@ public class Contacts implements Serializable {
                        }
                } else if ((faxCountry instanceof Country) && (faxAreaCode > 0) && (faxNumber > 0)) {
                        // Set new land-line number
-                       DialableFaxNumber fax = new FaxNumber(faxCountry, faxAreaCode, faxNumber);
+                       final DialableFaxNumber fax = new FaxNumber(faxCountry, faxAreaCode, faxNumber);
 
                        // Set it in contact
                        contact.setContactFaxNumber(fax);
@@ -229,7 +229,7 @@ public class Contacts implements Serializable {
                        }
                } else if ((phoneCountry instanceof Country) && (phoneAreaCode > 0) && (phoneNumber > 0)) {
                        // Set new land-line number
-                       DialableLandLineNumber landLine = new LandLineNumber(phoneCountry, phoneAreaCode, phoneNumber);
+                       final DialableLandLineNumber landLine = new LandLineNumber(phoneCountry, phoneAreaCode, phoneNumber);
 
                        // Set it in contact
                        contact.setContactLandLineNumber(landLine);
@@ -280,7 +280,7 @@ public class Contacts implements Serializable {
                        }
                } else if ((mobileProvider instanceof MobileProvider) && (mobileNumber > 0)) {
                        // Create new instance
-                       DialableMobileNumber mobile = new MobileNumber(mobileProvider, mobileNumber);
+                       final DialableMobileNumber mobile = new MobileNumber(mobileProvider, mobileNumber);
 
                        // Set it in contact
                        contact.setContactMobileNumber(mobile);
index ec5f8b68c949ac9ca09bc57c86dcdddffbd43fe1..3149586818c17523784c526fd8a079711c588dcc 100644 (file)
@@ -107,19 +107,26 @@ public class UserContact implements Contact {
        @OneToOne (targetEntity = CountryData.class, cascade = CascadeType.REFRESH, optional = false)
        private Country contactCountry;
 
+       /**
+        * Email address
+        */
+       @Column (name = "contact_email_address", length = 100, unique = true)
+       private String contactEmailAddress;
+
        /**
         * When the contact has been created
         */
        @Basic (optional = false)
        @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "contact_created", nullable = false)
-       private Date contactCreated;
+       @Column (name = "contact_entry_created", nullable = false)
+       private Date contactEntryCreated;
 
        /**
-        * Email address
+        * When the contact has been updated
         */
-       @Column (name = "contact_email_address", length = 100, unique = true)
-       private String contactEmailAddress;
+       @Temporal (TemporalType.TIMESTAMP)
+       @Column (name = "contact_entry_updated")
+       private Date contactEntryUpdated;
 
        /**
         * Family name
@@ -203,13 +210,6 @@ public class UserContact implements Contact {
        @Column (name = "contact_title")
        private String contactTitle;
 
-       /**
-        * When the contact has been updated
-        */
-       @Temporal (TemporalType.TIMESTAMP)
-       @Column (name = "contact_updated")
-       private Date contactUpdated;
-
        /**
         * ZIP code
         */
@@ -227,16 +227,34 @@ public class UserContact implements Contact {
        /**
         * Constructor for title and names
         * <p>
-        * @param contactTitle      Personal title
-        * @param contactFirstName  First name
-        * @param contactFamilyName Family name
+        * @param contactPersonalTitle Personal title
+        * @param contactFirstName     First name
+        * @param contactFamilyName    Family name
         */
-       public UserContact (final PersonalTitle contactTitle, final String contactFirstName, final String contactFamilyName) {
-               // Call default constructor
+       public UserContact (final PersonalTitle contactPersonalTitle, final String contactFirstName, final String contactFamilyName) {
+               // Invoke default constructor
                this();
 
+               // Are all parameter set?
+               if (null == contactFamilyName) {
+                       // Throw NPE
+                       throw new NullPointerException("contactFamilyName is null"); //NOI18N
+               } else if (contactFamilyName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("contactFamilyName is empty"); //NOI18N
+               } else if (null == contactFirstName) {
+                       // Throw NPE
+                       throw new NullPointerException("contactFirstName is null"); //NOI18N
+               } else if (contactFirstName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("contactFirstName is empty"); //NOI18N
+               } else if (null == contactPersonalTitle) {
+                       // Throw NPE
+                       throw new NullPointerException("contactPersonalTitle is null"); //NOI18N
+               }
+
                // Set all
-               this.contactPersonalTitle = contactTitle;
+               this.contactPersonalTitle = contactPersonalTitle;
                this.contactFirstName = contactFirstName;
                this.contactFamilyName = contactFamilyName;
        }
@@ -370,26 +388,38 @@ public class UserContact implements Contact {
                this.contactCountry = contactCountry;
        }
 
+       @Override
+       public String getContactEmailAddress () {
+               return this.contactEmailAddress;
+       }
+
+       @Override
+       public void setContactEmailAddress (final String contactEmailAddress) {
+               this.contactEmailAddress = contactEmailAddress;
+       }
+
        @Override
        @SuppressWarnings ("ReturnOfDateField")
-       public Date getContactCreated () {
-               return this.contactCreated;
+       public Date getContactEntryCreated () {
+               return this.contactEntryCreated;
        }
 
        @Override
        @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setContactCreated (final Date contactCreated) {
-               this.contactCreated = contactCreated;
+       public void setContactEntryCreated (final Date contactEntryCreated) {
+               this.contactEntryCreated = contactEntryCreated;
        }
 
        @Override
-       public String getContactEmailAddress () {
-               return this.contactEmailAddress;
+       @SuppressWarnings ("ReturnOfDateField")
+       public Date getContactEntryUpdated () {
+               return this.contactEntryUpdated;
        }
 
        @Override
-       public void setContactEmailAddress (final String contactEmailAddress) {
-               this.contactEmailAddress = contactEmailAddress;
+       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
+       public void setContactEntryUpdated (final Date contactEntryUpdated) {
+               this.contactEntryUpdated = contactEntryUpdated;
        }
 
        @Override
@@ -508,18 +538,6 @@ public class UserContact implements Contact {
                this.contactTitle = contactTitle;
        }
 
-       @Override
-       @SuppressWarnings ("ReturnOfDateField")
-       public Date getContactUpdated () {
-               return this.contactUpdated;
-       }
-
-       @Override
-       @SuppressWarnings ("AssignmentToDateFieldFromParameter")
-       public void setContactUpdated (final Date contactUpdated) {
-               this.contactUpdated = contactUpdated;
-       }
-
        @Override
        public Integer getContactZipCode () {
                return this.contactZipCode;