private final SafeText fCaptchaResponse;
private final Id fIpAddress;
private int fHashCode;
private void validateState() throws ModelCtorException {
ModelCtorException ex = new ModelCtorException();
if ( FAILS == Check.required(fLoginName, Check.range(6, 50)) ) {
ex.add("Login Name is required, must be at least 6 characters.");
}
if ( FAILS == Check.required(fScreenName, Check.range(6, 50)) ) {
ex.add("Screen Name is required, minimum 6 characters.");
}
if ( FAILS == Check.required(fPassword, Check.range(6, 50)) ) {
ex.add("Password is required, minimum 6 characters.");
}
if ( FAILS == Check.required(fPasswordConfirm, Check.range(6, 50)) ) {
ex.add("Password confirmation is required, must match the password supplied above.");
}
if( bothPasswordsPresent() && passwordsDontMatch() ){
ex.add("Password confirmation doesn't match the original password.");
}
if ( FAILS == Check.required(fEmail, Check.email()) ) {
ex.add("Valid email address is required (in case you forget your password).");
}
if( FAILS == isCaptchaPresent() ){
ex.add("Please type in the fuzzy characters (CAPTCHA)");
}
else if( FAILS == isCaptchaValid() ){
ex.add("CAPTCHA invalid. Please type in the fuzzy characters (CAPTCHA) again.");
}
if ( ! ex.isEmpty() ) throw ex;
}