Package org.passay
Class CharacterOccurrencesRule
- java.lang.Object
-
- org.passay.CharacterOccurrencesRule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for too many occurrences of a character.protected int
maxOccurrences
Maximum umber of occurrences to allow.
-
Constructor Summary
Constructors Constructor Description CharacterOccurrencesRule(int maxAllowedOccurrences)
Creates a new character occurrences rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters(char c, int occurrences)
Creates the parameter data for the rule result detail.String
toString()
RuleResult
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
-
-
-
Field Detail
-
ERROR_CODE
public static final String ERROR_CODE
Error code for too many occurrences of a character.- See Also:
- Constant Field Values
-
maxOccurrences
protected int maxOccurrences
Maximum umber of occurrences to allow.
-
-
Method Detail
-
validate
public RuleResult validate(PasswordData passwordData)
Description copied from interface:Rule
Validates the supplied password data per the requirements of this rule.
-
createRuleResultDetailParameters
protected Map<String,Object> createRuleResultDetailParameters(char c, int occurrences)
Creates the parameter data for the rule result detail.- Parameters:
c
- the character that occurred too many timesoccurrences
- the number of times the character occurred- Returns:
- map of parameter name to value
-
-