- always validate parameter of public/package/protected methods and constructors
- renamed i18nKey to messageKey
Signed-off-by: Roland Häder <roland@mxchange.org>
* @param messageKey Message key for resource file
*/
private Gender (final char accessChar, final String messageKey) {
+ // Validate parameter
+ if (null == messageKey) {
+ // Throw NPE
+ throw new NullPointerException("messageKey is null"); //NOI18N
+ } else if (messageKey.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("messageKey is empty"); //NOI18N
+ }
+
// Set both
this.accessChar = accessChar;
this.messageKey = messageKey;
* @param messageKey Message key for resource file
*/
private PersonalTitle (final char accessChar, final String messageKey) {
+ // Validate parameter
+ if (null == messageKey) {
+ // Throw NPE
+ throw new NullPointerException("messageKey is null"); //NOI18N
+ } else if (messageKey.isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("messageKey is empty"); //NOI18N
+ }
+
// Set both
this.accessChar = accessChar;
this.messageKey = messageKey;