public class SecretHintBuilderImpl extends Object implements SecretHintBuilder
TextAccessor.TextBuilder<B extends TextAccessor.TextBuilder<B>>, TextAccessor.TextMutator, TextAccessor.TextProperty
Constructor and Description |
---|
SecretHintBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
String[] |
getText()
Retrieves the text from the text property.
|
void |
setText(String... aText)
We create the secretized text here in order not to store clear text in
memory.
|
String |
toString()
The
String being build by the builder upon the settings of the
attributes. |
String |
toString(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
protected static String |
toString(String aSecret)
This method provides a password hint by keeping the first and the last
characters of the password and exchanging the rest by an asterisk "*".
|
String[] |
toStrings()
The
String s being build by the builder upon the settings of the
attributes. |
String[] |
toStrings(String... aText)
Race condition safe shortcut for using
Text.withText(String...) |
B |
withText(Collection<String> aText)
Sets the text for the text property.
|
B |
withText(String... aText)
Sets the text for the text property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getText
setText
withText
public void setText(String... aText)
setText
in interface TextAccessor.TextMutator
aText
- The text to be stored by the text property.public String[] toStrings()
Text
String
s being build by the builder upon the settings of the
attributes.toStrings
in interface Text<SecretHintBuilder>
String
arraypublic String[] toStrings(String... aText)
Text
Text.withText(String...)
followed by Text.toStrings()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by Text.toStrings()
(do
not change the text property) as this would not be thread safe!toStrings
in interface Text<SecretHintBuilder>
aText
- The text to be processed.String
arrayprotected static String toString(String aSecret)
aSecret
- The secret to be printedpublic String[] getText()
TextAccessor
getText
in interface TextAccessor
public B withText(String... aText)
TextAccessor.TextBuilder
public B withText(Collection<String> aText)
TextAccessor.TextBuilder
withText
in interface TextAccessor.TextBuilder<Text<B extends Text<B>>>
aText
- The text to be stored by the text property.public String toString()
public String toString(String... aText)
Text
Text.withText(String...)
followed by Text.toString()
.
Implementation requirements: This method must not(!) be implemented by
calling Text.withText(String...)
followed by Text.toString()
(do
not change the text property) as this would not be thread safe!Copyright © 2016. All rights reserved.