private State getDetailedCheckState() {
return new State() {
@Override
public State execute() {
PasswordCheckResult result = PasswordCheckUtil.INSTANCE.check(false, stateValues.getUserName(), new String(
stateValues.getPassword()));
if (result.getResult() == PasswordCheckResult.Result.WARN && stateValues.isSilentOrNonInteractive() == false) {
String message = result.getMessage();
String prompt = MESSAGES.sureToSetPassword(new String(stateValues.getPassword()));
State noState = new PromptNewUserState(theConsole, stateValues);
return new ConfirmationChoice(theConsole, message, prompt, ValidatePasswordState.this, noState);
}
if (result.getResult() == PasswordCheckResult.Result.REJECT) {
return new ErrorState(theConsole, result.getMessage(), getRetryState());
}
return ValidatePasswordState.this;
}