]> git.mxchange.org Git - jcore.git/commitdiff
It has to be first name and family name OR surname ... :-(
authorRoland Haeder <roland@mxchange.org>
Wed, 19 Aug 2015 09:51:44 +0000 (11:51 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 19 Aug 2015 09:51:44 +0000 (11:51 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jcore/contact/BaseContact.java
src/org/mxchange/jcore/contact/Contact.java

index 19ff2819c182946dc4116be6fa990fbe9cfddf63..a26027a24b672bbcb224c666ba8b7c109c23ac9b 100644 (file)
@@ -78,6 +78,11 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
         */
        private String faxNumber;
 
+       /**
+        * First name
+        */
+       private String firstName;
+
        /**
         * Gender instance
         */
@@ -103,11 +108,6 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
         */
        private String street;
 
-       /**
-        * Surname
-        */
-       private String surname;
-
        /**
         * ZIP code
         */
@@ -143,7 +143,7 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
 
                // Now test some data @todo Definedly needs improvement
                return ((this.getGender().equals(contact.getGender()))
-                               && (this.getSurname().toLowerCase().equals(contact.getSurname().toLowerCase()))
+                               && (this.getFirstName().toLowerCase().equals(contact.getFirstName().toLowerCase()))
                                && (this.getFamilyName().toLowerCase().equals(contact.getFamilyName().toLowerCase())));
        }
 
@@ -329,6 +329,26 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
                this.faxNumber = faxNumber;
        }
 
+       /**
+        * First name
+        *
+        * @return the firstName
+        */
+       @Override
+       public final String getFirstName () {
+               return this.firstName;
+       }
+
+       /**
+        * First name
+        *
+        * @param firstName the firstName to set
+        */
+       @Override
+       public final void setFirstName (final String firstName) {
+               this.firstName = firstName;
+       }
+
        /**
         * Gender of the contact
         *
@@ -409,26 +429,6 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
                this.street = street;
        }
 
-       /**
-        * Surname
-        *
-        * @return the surname
-        */
-       @Override
-       public final String getSurname () {
-               return this.surname;
-       }
-
-       /**
-        * Surname
-        *
-        * @param surname the surname to set
-        */
-       @Override
-       public final void setSurname (final String surname) {
-               this.surname = surname;
-       }
-
        /**
         * Some "getter" for a translated/human-readable gender
         *
@@ -514,20 +514,10 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
                int hash = 7;
                hash = 79 * hash + Objects.hashCode(this.getFamilyName());
                hash = 79 * hash + this.getGender().hashCode();
-               hash = 79 * hash + Objects.hashCode(this.getSurname());
+               hash = 79 * hash + Objects.hashCode(this.getFirstName());
                return hash;
        }
 
-       /**
-        * Checks whether the contact is user's own data
-        *
-        * @return Own data?
-        */
-       @Override
-       public final boolean isOwnContact () {
-               return this.ownContact;
-       }
-
        /**
         * Checks if given boolean field is available and set to same value
         *
@@ -562,6 +552,16 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
                return isFound;
        }
 
+       /**
+        * Checks whether the contact is user's own data
+        *
+        * @return Own data?
+        */
+       @Override
+       public final boolean isOwnContact () {
+               return this.ownContact;
+       }
+
        /**
         * Returns an iterator of all values from this object
         * @return An iterator
@@ -571,6 +571,18 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
                return this.fieldIterator(this, "BaseContact"); //NOI18N
        }
 
+       @Override
+       public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+               // Trace message
+               this.getLogger().trace(MessageFormat.format("columnName={0},value={1} - CALLED!", columnName, value)); //NOI18N
+               
+               // Call super method
+               this.setValueInStoreableFromColumn(this, "BaseContact", columnName, value); //NOI18N
+               
+               // Trace message
+               this.getLogger().trace("EXIT!"); //NOI18N
+       }
+
        /**
         * Shows this contact to the user
         *
@@ -604,16 +616,4 @@ public class BaseContact extends BaseFrameworkSystem implements Contact {
        protected final void enableFlagOwnContact () {
                this.ownContact = true;
        }
-
-       @Override
-       public void setValueFromColumn (final String columnName, final Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
-               // Trace message
-               this.getLogger().trace(MessageFormat.format("columnName={0},value={1} - CALLED!", columnName, value)); //NOI18N
-
-               // Call super method
-               this.setValueInStoreableFromColumn(this, "BaseContact", columnName, value); //NOI18N
-
-               // Trace message
-               this.getLogger().trace("EXIT!"); //NOI18N
-       }
 }
index 31bd9ecf614b8f1b865a7edc127b0fcdb6a55cf7..11664e6a42aa3b298a60579cdd7f2e8f7a43e9a7 100644 (file)
@@ -65,14 +65,14 @@ public interface Contact extends Storeable {
         *
         * @return the surname
         */
-       public String getSurname ();
+       public String getFirstName ();
 
        /**
         * Surname
         *
         * @param surname the surname to set
         */
-       public void setSurname (final String surname);
+       public void setFirstName (final String surname);
 
        /**
         * Family name