Class StoredCredential

  • All Implemented Interfaces:
    StoredSecret

    public final class StoredCredential
    extends Object
    implements StoredSecret
    Credential for user authentication.
    • Constructor Detail

      • StoredCredential

        public StoredCredential​(String username,
                                char[] password)
        Creates a credential object with a username and password pair.
        Parameters:
        username - The username value of the StoredCredential.
        password - The password value of the StoredCredential.
    • Method Detail

      • getUsername

        public String getUsername()
        Unique identifier of the user.
        Returns:
        username
      • getPassword

        public char[] getPassword()
        Secret related to the username.
        Returns:
        secret
      • clear

        public void clear()
        Clear the secret value.
        Specified by:
        clear in interface StoredSecret
      • equals

        public boolean equals​(Object o)
        Compares an object to this StoredCredential for equality.
        Overrides:
        equals in class Object
        Parameters:
        o - The object to compare.
        Returns:
        True if equal; false otherwise.
      • hashCode

        public int hashCode()
        Gets a hash code based on the contents of the StoredCredential.
        Overrides:
        hashCode in class Object
        Returns:
        32-bit hash code.