Package org.drasyl.util
Class MaskedString
- java.lang.Object
-
- org.drasyl.util.MaskedString
-
public final class MaskedString extends Object
Represents a confidential string (like a password or a secret token) whose content is masked intoString()
. Do not use this class if the length of the string must not be revealed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
static MaskedString
of(String string)
String
toString()
Returns a masked representation of thisString
.String
toUnmaskedString()
Returns the unmasked representation of thisString
.
-
-
-
Method Detail
-
toString
public String toString()
Returns a masked representation of thisString
. Each character is replaced with*
.
-
toUnmaskedString
public String toUnmaskedString()
Returns the unmasked representation of thisString
.- Returns:
- unmasked representation of this
String
-
of
public static MaskedString of(String string)
-
-