X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2Forg%2Fmxchange%2Fjcontacts%2Fmodel%2Fcontact%2Ftitle%2FPersonalTitle.java;h=36d30f3fbbd761009a8ebc8b62a14b70009dbbe6;hb=7df4118c9b2349af841c0d43d96fa1400084c7d4;hp=8b093e72dd1e7c93660aa90ed87ed6adfb966962;hpb=7e6d77d5868c8d5fa5a38f109698654a51383182;p=jcontacts-core.git diff --git a/src/org/mxchange/jcontacts/model/contact/title/PersonalTitle.java b/src/org/mxchange/jcontacts/model/contact/title/PersonalTitle.java index 8b093e7..36d30f3 100644 --- a/src/org/mxchange/jcontacts/model/contact/title/PersonalTitle.java +++ b/src/org/mxchange/jcontacts/model/contact/title/PersonalTitle.java @@ -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;