From: Roland Häder Date: Thu, 6 Oct 2022 12:50:29 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a58a309812ec5cc47360b8259e9699712b6db9d3;p=jcontacts-core.git Continued: - renamed method allGendersAsList() to allGenders() as this will always be a list - sorted checking of parameters in order how they are provided --- diff --git a/src/org/mxchange/jcontacts/model/contact/UserContact.java b/src/org/mxchange/jcontacts/model/contact/UserContact.java index 7722a28..93cdfa3 100644 --- a/src/org/mxchange/jcontacts/model/contact/UserContact.java +++ b/src/org/mxchange/jcontacts/model/contact/UserContact.java @@ -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 diff --git a/src/org/mxchange/jcontacts/model/contact/gender/GenderUtils.java b/src/org/mxchange/jcontacts/model/contact/gender/GenderUtils.java index eed871c..8abd41e 100644 --- a/src/org/mxchange/jcontacts/model/contact/gender/GenderUtils.java +++ b/src/org/mxchange/jcontacts/model/contact/gender/GenderUtils.java @@ -22,7 +22,7 @@ import java.util.LinkedList; import java.util.List; /** - * Gender utils class + * Gender utilities class *

* @author Roland Häder */ @@ -43,7 +43,7 @@ public class GenderUtils implements Serializable { *

* @return Selectable genders (not UNKNOWN) */ - public static List allGendersAsList () { + public static List allGenders () { // Init list final List list = new LinkedList<>(); @@ -61,7 +61,7 @@ public class GenderUtils implements Serializable { * Getter for Gender enumeration from given character *

* @param c Gender character -

+ *

* @return Gender enumeration */ public static Gender fromChar (final char c) {