- throw new NullPointerException("message is null"); //NOI18N
- } else if (!(message instanceof ObjectMessage)) {
- // Not implementing right interface
- throw new IllegalArgumentException(MessageFormat.format("message={0} does not implemented ObjectMessage", message)); //NOI18N
+ throw new NullPointerException("user is null"); //NOI18N
+ } else if (user.getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("user.userId is null"); //NOI18N
+ } else if (user.getUserId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
+ } else if (user.getUserConfirmKey() == null) {
+ // Throw NPE again
+ throw new NullPointerException("this.userConfirmKey is null"); //NOI18N
+ } else if (user.getUserAccountStatus() != UserAccountStatus.UNCONFIRMED) {
+ // User account status is not UNCONFIRMED
+ throw new IllegalStateException(MessageFormat.format("Account status from user.userId={0} is not UNCONFIRMED:{1}", user.getUserId(), user.getUserAccountStatus())); //NOI18N
+ } else if (null == locale) {
+ // Locale should be set
+ throw new NullPointerException("locale is null"); //NOI18N