public class MaskedPasswordBuilder
extends java.lang.Object
Constructor and Description |
---|
MaskedPasswordBuilder(java.lang.String stringToMask)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
build()
Builds the masked string.
|
boolean |
currentCharIs(java.lang.Character character)
Returns
true if the current character is character . |
boolean |
currentCharIsOneOf(java.lang.Character... choices)
Returns
true of the current character is one of the choices . |
boolean |
currentCharIsWhitespace()
Returns
true if the current character is a whitespace. |
boolean |
findNextPassword()
Returns
true if there is another password to be found in the string to mask. |
int |
getCurrentIndex()
Returns the current index.
|
boolean |
hasNext()
Returns
true if the string to mask has more characters. |
void |
mark()
Saves the current index, to be used by
reset() . |
void |
maskPasswordAt(java.lang.Integer index)
Appends the password mask at the
index . |
void |
next()
Advances the cursor to the next character.
|
void |
reset()
Resets the current character (or index) to the one set by
mark() . |
public MaskedPasswordBuilder(java.lang.String stringToMask)
public boolean hasNext()
true
if the string to mask has more characters.public void next()
public boolean currentCharIsOneOf(java.lang.Character... choices)
true
of the current character is one of the choices
.public boolean currentCharIs(java.lang.Character character)
true
if the current character is character
.public boolean currentCharIsWhitespace()
true
if the current character is a whitespace.public void mark()
reset()
.public void reset()
mark()
.public void maskPasswordAt(java.lang.Integer index)
index
.public int getCurrentIndex()
public boolean findNextPassword()
true
if there is another password to be found in the string to mask.public java.lang.String build()