]> git.mxchange.org Git - jaddressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/contact/Gender.java
Added more input fields and overwritten toString() in Gender enum
[jaddressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / contact / Gender.java
index a2740595432101b6f7e19c4eacc81531e3c6701e..6bd68df38d9ea1a745564c176dee70d483ddd945 100644 (file)
@@ -16,6 +16,8 @@
  */
 package org.mxchange.addressbook.contact;
 
+import org.mxchange.addressbook.application.AddressbookApplication;
+
 /**
  * Gender enum
  * @author Roland Haeder
@@ -104,8 +106,8 @@ public enum Gender {
                        // Debug message
                        //* NOISY-DEBUG: */ System.out.println("gender=" + gender);
 
-                       // Is it "U"?
-                       if (gender.getDatabaseValue().equals("U")) {
+                       // Is it UNKNOWN?
+                       if (gender.equals(Gender.UNKNOWN)) {
                                // Skip this
                                continue;
                        }
@@ -166,4 +168,15 @@ public enum Gender {
        protected String getMessageKey () {
                return this.messageKey;
        }
+
+       /**
+        * Overwritten to return human-readable strings
+        * 
+        * @return Human-readable strings
+        */
+       @Override
+       public String toString () {
+               // Get key from bundle and return it
+               return AddressbookApplication.getInstance().getMessageStringFromKey(this.getMessageKey());
+       }
 }