- constructors of enumerations cannot be unit-tested with null references, also
they are private by definition and those methods and constructors are really
hard to test. Still making all methods and constructors public only for being
unit-tested isn't right, too
* @param messageKey Message key (i18n)
*/
private EmailChangeStatus (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 it here
this.messageKey = messageKey;
}