public class PasswordConfig
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
PasswordConfig(java.util.SortedMap<java.lang.Integer,java.lang.String> levels,
java.util.List<PasswordRule> rules)
Creates a new password configuration.
|
| Modifier and Type | Method and Description |
|---|---|
static PasswordConfig |
defaultConfig()
Returns the default configuration
|
java.lang.String |
getLevel(int score)
Returns the level for a given score.
|
int |
getThreshold(java.lang.String level)
Returns the minimum score required to match this level.
|
boolean |
isDefined(java.lang.String level)
Indicates whether a level is defined in the specified configuration.
|
java.util.List<java.lang.String> |
levels()
Returns the list of levels in order of threshold.
|
static PasswordConfig |
load(java.io.File file)
Parses the specified file.
|
static PasswordConfig |
load(org.xml.sax.InputSource source)
Parses the specified file.
|
java.util.List<PasswordRule> |
rules()
Returns the rules in this configuration
|
protected PasswordConfig(java.util.SortedMap<java.lang.Integer,java.lang.String> levels,
java.util.List<PasswordRule> rules)
public java.lang.String getLevel(int score)
score - the scorepublic int getThreshold(java.lang.String level)
level - the leveljava.lang.IllegalArgumentException - If the level is undefined.java.lang.NullPointerException - If the level is null.public boolean isDefined(java.lang.String level)
level - the leveltrue if the level is defined in this configuration; false otherwise.public java.util.List<java.lang.String> levels()
public java.util.List<PasswordRule> rules()
public static PasswordConfig defaultConfig()
public static PasswordConfig load(java.io.File file)
public static PasswordConfig load(org.xml.sax.InputSource source)