]> git.mxchange.org Git - jcontacts-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 12:50:29 +0000 (14:50 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Oct 2022 12:50:29 +0000 (14:50 +0200)
- renamed method allGendersAsList() to allGenders() as this will always be a
  list
- sorted checking of parameters in order how they are provided

src/org/mxchange/jcontacts/model/contact/UserContact.java
src/org/mxchange/jcontacts/model/contact/gender/GenderUtils.java

index 7722a28cb8c94c3d910945c6f59d677719d525a7..93cdfa3d75b1cab4f657a8c84eab3a11e184c66f 100644 (file)
@@ -236,21 +236,21 @@ public class UserContact implements Contact {
                this();
 
                // Are all parameter set?
-               if (null == contactFamilyName) {
+               if (null == contactPersonalTitle) {
                        // Throw NPE
-                       throw new NullPointerException("contactFamilyName is null"); //NOI18N
-               } else if (contactFamilyName.isEmpty()) {
-                       // Throw IAE
-                       throw new IllegalArgumentException("contactFamilyName is empty"); //NOI18N
+                       throw new NullPointerException("contactPersonalTitle is null"); //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) {
+               } else if (null == contactFamilyName) {
                        // Throw NPE
-                       throw new NullPointerException("contactPersonalTitle is null"); //NOI18N
+                       throw new NullPointerException("contactFamilyName is null"); //NOI18N
+               } else if (contactFamilyName.isEmpty()) {
+                       // Throw IAE
+                       throw new IllegalArgumentException("contactFamilyName is empty"); //NOI18N
                }
 
                // Set all
index eed871c41352405e8654caf87a9fe526a4096b08..8abd41e27171fdb8f97ee4d41c538e16d6faf300 100644 (file)
@@ -22,7 +22,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 /**
- * Gender utils class
+ * Gender utilities class
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
@@ -43,7 +43,7 @@ public class GenderUtils implements Serializable {
         * <p>
         * @return Selectable genders (not UNKNOWN)
         */
-       public static List<Gender> allGendersAsList () {
+       public static List<Gender> allGenders () {
                // Init list
                final List<Gender> list = new LinkedList<>();
 
@@ -61,7 +61,7 @@ public class GenderUtils implements Serializable {
         * Getter for Gender enumeration from given character
         * <p>
         * @param c Gender character
- <p>
       * <p>
         * @return Gender enumeration
         */
        public static Gender fromChar (final char c) {