|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unearthedjava.passwordPress.UnearthedPassword
UnearthedPassword can be integrated into other applications. Note: This will throw an exception if you do not follow the rules which match the program (only 1 type (between numeric, alphabetic, and alphanumeric), required length does not exceed maximum possible based on the options selected, etc.).
Field Summary | |
static java.lang.String |
IS_ALPHA
|
static java.lang.String |
IS_ALPHANUM
|
static java.lang.String |
IS_NUMERIC
|
Constructor Summary | |
UnearthedPassword()
base constructor |
|
UnearthedPassword(int passwordLength,
boolean allowDups,
boolean mixCase,
java.lang.String type)
constructor for using class as a factory for other applications. uses the following parameters: |
Method Summary | |
int |
getMaxLength()
calculate the max length that a password can be. |
java.lang.String |
getNewPassword()
randomly builds a new password string for the user. |
int |
getPasswordLength()
|
boolean |
isAllowDups()
|
boolean |
isAlpha()
|
boolean |
isAlphanum()
|
boolean |
isMixCase()
|
boolean |
isNumeric()
|
void |
setAllowDups(boolean allowDups)
|
void |
setAlpha(boolean isAlpha)
|
void |
setAlphanum(boolean isAlphanum)
|
void |
setMixCase(boolean mixCase)
|
void |
setNumeric(boolean isNumeric)
|
void |
setPasswordLength(int passwordLength)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String IS_NUMERIC
public static final java.lang.String IS_ALPHA
public static final java.lang.String IS_ALPHANUM
Constructor Detail |
public UnearthedPassword()
public UnearthedPassword(int passwordLength, boolean allowDups, boolean mixCase, java.lang.String type) throws java.lang.Exception
Example of use:
try { PasswordPress test = new UnearthedPassword(10, // length required false, // allow duplicate characters false, // mix letter case PasswordPress.IS_ALPHANUM); // alphanumeric String password = test.getNewPassword(); System.out.println(password); } catch (Exception e) { System.out.println(e.getMessage()); }
Method Detail |
public int getMaxLength()
public java.lang.String getNewPassword()
public boolean isAllowDups()
public void setAllowDups(boolean allowDups)
allowDups
- The allowDups to set.public boolean isAlpha()
public void setAlpha(boolean isAlpha)
isAlpha
- The isAlpha to set.public boolean isAlphanum()
public void setAlphanum(boolean isAlphanum)
isAlphanum
- The isAlphanum to set.public boolean isNumeric()
public void setNumeric(boolean isNumeric)
isNumeric
- The isNumeric to set.public boolean isMixCase()
public void setMixCase(boolean mixCase)
mixCase
- The mixCase to set.public int getPasswordLength()
public void setPasswordLength(int passwordLength)
passwordLength
- The passwordLength to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |