Package org.passay
Class NumberRangeRule
- java.lang.Object
-
- org.passay.NumberRangeRule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ERROR_CODE
Error code for whitespace rule violation.protected boolean
reportAllFailures
Whether to report all sequence matches or just the first.
-
Constructor Summary
Constructors Constructor Description NumberRangeRule(int lower, int upper)
Creates a new number range rule.NumberRangeRule(int lower, int upper, boolean reportAll)
Creates a new number range rule.NumberRangeRule(int lower, int upper, MatchBehavior behavior)
Creates a new number range rule.NumberRangeRule(int lower, int upper, MatchBehavior behavior, boolean reportAll)
Creates a new number range rule.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
createRuleResultDetailParameters(int number)
Creates the parameter data for the rule result detail.int
getLowerRange()
Returns the lower range for this rule.MatchBehavior
getMatchBehavior()
Returns the match behavior for this rule.int
getUpperRange()
Returns the upper range for this rule.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 whitespace rule violation.- See Also:
- Constant Field Values
-
reportAllFailures
protected boolean reportAllFailures
Whether to report all sequence matches or just the first.
-
-
Constructor Detail
-
NumberRangeRule
public NumberRangeRule(int lower, int upper)
Creates a new number range rule.- Parameters:
lower
- end of the number range, inclusiveupper
- end of the number range, exclusive
-
NumberRangeRule
public NumberRangeRule(int lower, int upper, boolean reportAll)
Creates a new number range rule.- Parameters:
lower
- end of the number range, inclusiveupper
- end of the number range, exclusivereportAll
- whether to report all matches or just the first
-
NumberRangeRule
public NumberRangeRule(int lower, int upper, MatchBehavior behavior)
Creates a new number range rule.- Parameters:
lower
- end of the number range, inclusiveupper
- end of the number range, exclusivebehavior
- how to match number range
-
NumberRangeRule
public NumberRangeRule(int lower, int upper, MatchBehavior behavior, boolean reportAll)
Creates a new number range rule.- Parameters:
lower
- end of the number range, inclusiveupper
- end of the number range, exclusivebehavior
- how to match number rangereportAll
- whether to report all matches or just the first
-
-
Method Detail
-
getLowerRange
public int getLowerRange()
Returns the lower range for this rule.- Returns:
- lower range
-
getUpperRange
public int getUpperRange()
Returns the upper range for this rule.- Returns:
- upper range
-
getMatchBehavior
public MatchBehavior getMatchBehavior()
Returns the match behavior for this rule.- Returns:
- match behavior
-
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(int number)
Creates the parameter data for the rule result detail.- Parameters:
number
- matching number- Returns:
- map of parameter name to value
-
-