Class MaskedString


  • public final class MaskedString
    extends Object
    Represents a confidential string (like a password or a secret token) whose content is masked in toString(). Do not use this class if the length of the string must not be revealed.
    • Method Detail

      • toString

        public String toString()
        Returns a masked representation of this String. Each character is replaced with *.
        Overrides:
        toString in class Object
        Returns:
        masked representation of this String. Each character is replaced with *.
      • toUnmaskedString

        public String toUnmaskedString()
        Returns the unmasked representation of this String.
        Returns:
        unmasked representation of this String
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object