Package org.passay
Class AbstractValidationResult
java.lang.Object
org.passay.AbstractValidationResult
- All Implemented Interfaces:
ValidationResult
- Direct Known Subclasses:
FailureValidationResult,SuccessValidationResult
Base class for validation results.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleEntropy of the password used for validation.private final RuleResultMetadataMetadata produced by a password rule.private final booleanWhether password rule was successful. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractValidationResult(boolean valid, double entropy, RuleResultMetadata metadata) Creates a new abstract validation result.AbstractValidationResult(boolean valid, RuleResultMetadata metadata) Creates a new abstract validation result. -
Method Summary
Modifier and TypeMethodDescriptionReturns any details associated with the rule verification.doubleReturns the calculated entropy of thePasswordDataused to produce this validation result, based on the password rules specified.Returns a list of human-readable messages by iterating over the details in a failed rule result.Returns metadata associated with the rule verification.booleanisValid()Returns whether the result of the rule verification is a valid password.toString()
-
Field Details
-
valid
private final boolean validWhether password rule was successful. -
entropy
private final double entropyEntropy of the password used for validation. -
metadata
Metadata produced by a password rule.
-
-
Constructor Details
-
AbstractValidationResult
Creates a new abstract validation result.- Parameters:
valid- whether validation was successfulmetadata- metadata associated by the rule with the password
-
AbstractValidationResult
Creates a new abstract validation result.- Parameters:
valid- whether validation was successfulentropy- calculated entropy of the passwordmetadata- metadata associated by the rule with the password
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:ValidationResultReturns whether the result of the rule verification is a valid password.- Specified by:
isValidin interfaceValidationResult- Returns:
- valid password for this rule
-
getEntropy
public double getEntropy()Description copied from interface:ValidationResultReturns the calculated entropy of thePasswordDataused to produce this validation result, based on the password rules specified.- Specified by:
getEntropyin interfaceValidationResult- Returns:
- entropy estimate
-
getMetadata
Description copied from interface:ValidationResultReturns metadata associated with the rule verification.- Specified by:
getMetadatain interfaceValidationResult- Returns:
- rule result metadata
-
getDetails
Description copied from interface:ValidationResultReturns any details associated with the rule verification.- Specified by:
getDetailsin interfaceValidationResult- Returns:
- rule result details
-
getMessages
Description copied from interface:ValidationResultReturns a list of human-readable messages by iterating over the details in a failed rule result.- Specified by:
getMessagesin interfaceValidationResult- Returns:
- list of human-readable messages describing the reason(s) for validation failure.
-
toString
-