public class RuleResult extends Object
Modifier and Type | Field and Description |
---|---|
protected List<RuleResultDetail> |
details
Details associated with a password rule result.
|
protected RuleResultMetadata |
metadata
Metadata produced by a password rule.
|
protected boolean |
valid
Whether password rule was successful.
|
Constructor and Description |
---|
RuleResult()
Creates a new rule result with its validity set to true.
|
RuleResult(boolean b)
Creates a new rule result.
|
RuleResult(boolean b,
RuleResultDetail rrd)
Creates a new rule result.
|
RuleResult(boolean b,
RuleResultDetail rrd,
RuleResultMetadata rrm)
Creates a new rule result.
|
RuleResult(boolean b,
RuleResultMetadata rrm)
Creates a new rule result.
|
Modifier and Type | Method and Description |
---|---|
void |
addError(String[] codes,
Map<String,Object> params)
Adds a new rule result detail under multiple error codes.
|
void |
addError(String code,
Map<String,Object> params)
Adds a new rule result detail with the given error details and
sets the result of the rule verification to invalid.
|
List<RuleResultDetail> |
getDetails()
Returns any details associated with the rule verification.
|
RuleResultMetadata |
getMetadata()
Returns metadata associated with the rule verification.
|
boolean |
isValid()
Returns whether the result of the rule verification is a valid password.
|
void |
setDetails(List<RuleResultDetail> rrd)
Sets any details associated with the rule verification.
|
void |
setDetails(RuleResultDetail... rrd)
Sets any details associated with the rule verification.
|
void |
setMetadata(RuleResultMetadata rrm)
Sets metadata associated with the rule verification.
|
void |
setValid(boolean b)
Sets whether the result of the rule verification is a valid password.
|
String |
toString() |
protected boolean valid
protected List<RuleResultDetail> details
protected RuleResultMetadata metadata
public RuleResult()
public RuleResult(boolean b)
b
- result validitypublic RuleResult(boolean b, RuleResultDetail rrd)
b
- result validityrrd
- details associated with this resultpublic RuleResult(boolean b, RuleResultMetadata rrm)
b
- result validityrrm
- metadata associated by the rule with the passwordpublic RuleResult(boolean b, RuleResultDetail rrd, RuleResultMetadata rrm)
b
- result validityrrd
- details associated with this resultrrm
- metadata associated by the rule with the passwordpublic boolean isValid()
public void setValid(boolean b)
b
- valid password for this rulepublic List<RuleResultDetail> getDetails()
public void addError(String code, Map<String,Object> params)
code
- error codeparams
- error detailspublic void addError(String[] codes, Map<String,Object> params)
codes
- error codes in order of most specific to least specificparams
- error detailspublic void setDetails(RuleResultDetail... rrd)
rrd
- rule result detailspublic void setDetails(List<RuleResultDetail> rrd)
rrd
- rule result detailspublic RuleResultMetadata getMetadata()
public void setMetadata(RuleResultMetadata rrm)
rrm
- rule result metadataCopyright © 2003-2024 Virginia Tech. All Rights Reserved.