public class CharacterCharacteristicsRule extends Object implements Rule
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_CODE
Error code for insufficient number of characteristics.
|
Constructor and Description |
---|
CharacterCharacteristicsRule()
Default constructor.
|
CharacterCharacteristicsRule(CharacterRule... r)
Creates a new character characteristics rule.
|
CharacterCharacteristicsRule(int n,
CharacterRule... r)
Creates a new character characteristics rule.
|
CharacterCharacteristicsRule(int n,
List<CharacterRule> l)
Creates a new character characteristics rule.
|
CharacterCharacteristicsRule(List<CharacterRule> l)
Creates a new character characteristics rule.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
createRuleResultDetailParameters(int success)
Creates the parameter data for the rule result detail.
|
int |
getNumberOfCharacteristics()
Returns the number of characteristics which currently must be satisfied in order for a password to meet the
requirements of this rule.
|
boolean |
getReportFailure()
Returns whether to add the rule result detail of this rule to the rule result.
|
boolean |
getReportRuleFailures()
Returns whether to add the rule result detail for each character rule that fails to validate to the rule result.
|
List<CharacterRule> |
getRules()
Returns the character rules used by this rule.
|
void |
setNumberOfCharacteristics(int n)
Sets the number of characteristics which must be satisfied in order for a password to meet the requirements of this
rule.
|
void |
setReportFailure(boolean b)
Sets whether to add the rule result detail of this rule to the rule result.
|
void |
setReportRuleFailures(boolean b)
Sets whether to add the rule result detail for each character rule that fails to validate to the rule result.
|
void |
setRules(CharacterRule... r)
Sets the character rules used by this rule.
|
void |
setRules(List<CharacterRule> l)
Sets the character rules used by this rule.
|
String |
toString() |
RuleResult |
validate(PasswordData passwordData)
Validates the supplied password data per the requirements of this rule.
|
public static final String ERROR_CODE
public CharacterCharacteristicsRule()
public CharacterCharacteristicsRule(CharacterRule... r)
r
- character rules to setpublic CharacterCharacteristicsRule(List<CharacterRule> l)
l
- character rules to setpublic CharacterCharacteristicsRule(int n, CharacterRule... r)
n
- number of characteristics to enforce, where n > 0r
- character rules to setpublic CharacterCharacteristicsRule(int n, List<CharacterRule> l)
n
- number of characteristics to enforce, where n > 0l
- character rules to setpublic List<CharacterRule> getRules()
public void setRules(List<CharacterRule> l)
l
- list of rulespublic void setRules(CharacterRule... r)
r
- character rules to setpublic void setNumberOfCharacteristics(int n)
n
- number of characteristics to enforce, where n > 0public boolean getReportFailure()
public void setReportFailure(boolean b)
b
- whether to add rule result detail of this rulepublic int getNumberOfCharacteristics()
public boolean getReportRuleFailures()
public void setReportRuleFailures(boolean b)
b
- whether to add character rule result detailspublic RuleResult validate(PasswordData passwordData)
Rule
protected Map<String,Object> createRuleResultDetailParameters(int success)
success
- number of successful rulesCopyright © 2003-2024 Virginia Tech. All Rights Reserved.