All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rodeo.password.pgencheck.PasswordCheckError Maven / Gradle / Ivy

Go to download

This project provides classes to create and validate passwords. A number of criteria can be provided (minimum and maximum length, presence of certain character types, etc.) to validate and create passwords. Any Unicode character can be used in the generation and validation of passwords.

The newest version!
package rodeo.password.pgencheck;

/**
 * Records a password validation error.
 * 

* For some errors, more information need to be reported. For these errors, a subclass of this class is used. */ public class PasswordCheckError { private final PasswordCheckStatus errorType; PasswordCheckError(PasswordCheckStatus errorType) { this.errorType = errorType; } static PasswordCheckError tooShort() { return new PasswordCheckError(PasswordCheckStatus.TOO_SHORT); } static PasswordCheckError tooLong() { return new PasswordCheckError(PasswordCheckStatus.TOO_LONG); } static PasswordCheckError illegalCharacter(int illegalCharacter) { return new IllegalCharacterError(illegalCharacter); } static PasswordCheckError notEnoughOfCharacterType( int missingCharacterListIndex, String missingCharacterList, int expectedCount, int actualCount) { return new BadCountForCharacterTypeError( PasswordCheckStatus.NOT_ENOUGH_OF_CHARACTER_GROUP, missingCharacterListIndex, missingCharacterList, expectedCount, actualCount); } static PasswordCheckError tooManyOfCharacterType( int missingCharacterListIndex, String missingCharacterList, int expectedCount, int actualCount) { return new BadCountForCharacterTypeError( PasswordCheckStatus.TOO_MANY_OF_CHARACTER_GROUP, missingCharacterListIndex, missingCharacterList, expectedCount, actualCount); } /** * Returns the recorded error types. * @return the error type * @see PasswordCheckStatus */ public PasswordCheckStatus getErrorType() { return errorType; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy