]> git.mxchange.org Git - jcontacts-core.git/blobdiff - src/org/mxchange/jcontacts/model/contact/title/PersonalTitle.java
Continued:
[jcontacts-core.git] / src / org / mxchange / jcontacts / model / contact / title / PersonalTitle.java
index 8b093e72dd1e7c93660aa90ed87ed6adfb966962..36d30f3fbbd761009a8ebc8b62a14b70009dbbe6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Free Software Foundation
+ * Copyright (C) 2016 - 2020 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -53,6 +53,15 @@ public enum PersonalTitle implements Serializable {
         * @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;