public class RepeatCharactersRule extends Object implements Rule
For example, the password "11a22b333xyz" will fail validation of this rule with a sequence length of 2 and sequence count of 3, since it contains 3 sequences (or more) of 2 repeating characters (or more).
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEQUENCE_COUNT
Default number of sequences, value is 1.
|
static int |
DEFAULT_SEQUENCE_LENGTH
Default length of sequence, value is 5.
|
static String |
ERROR_CODE
Error code for regex validation failures.
|
protected int |
sequenceCount
Number of sequences of repeating characters to match.
|
protected int |
sequenceLength
Number of repeating characters to match in each sequence.
|
Constructor and Description |
---|
RepeatCharactersRule()
Creates a new repeat characters rule for a single sequence of the default sequence length.
|
RepeatCharactersRule(int sl)
Creates a new repeat characters rule for a single sequence of the given length.
|
RepeatCharactersRule(int sl,
int sc)
Creates a new repeat characters rule for the given number of sequences of the given length.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
createRuleResultDetailParameters(List<String> matches)
Creates the parameter data for the rule result detail.
|
RuleResult |
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
|
public static final String ERROR_CODE
public static final int DEFAULT_SEQUENCE_LENGTH
public static final int DEFAULT_SEQUENCE_COUNT
protected int sequenceLength
protected int sequenceCount
public RepeatCharactersRule()
public RepeatCharactersRule(int sl)
sl
- sequence lengthpublic RepeatCharactersRule(int sl, int sc)
sl
- sequence lengthsc
- sequence countpublic RuleResult validate(PasswordData passwordData)
Rule
Copyright © 2003-2024 Virginia Tech. All Rights Reserved.