Class PasswordCredential

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char[] password
      Must be char array for security!! (Strings end up in the constant pool, etc.)
      private java.lang.String username
      The user name associated with the credential.
    • Constructor Summary

      Constructors 
      Constructor Description
      PasswordCredential​(java.lang.String username, char[] password)
      Create a new PasswordCredential using a char array as password.
      PasswordCredential​(java.lang.String username, java.lang.String password)
      Create a new PasswordCredential using a String as password.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      char[] getPassword()
      Gets the password.
      java.lang.String getUsername()
      Returns the user name associated with this credential.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • username

        private final java.lang.String username
        The user name associated with the credential.
      • password

        private final char[] password
        Must be char array for security!! (Strings end up in the constant pool, etc.)
    • Constructor Detail

      • PasswordCredential

        public PasswordCredential​(java.lang.String username,
                                  java.lang.String password)
        Create a new PasswordCredential using a String as password. This String will immediately be converted into a char array internally.
        Parameters:
        username - the user name of the credential.
        password - the password of the credential.
      • PasswordCredential

        public PasswordCredential​(java.lang.String username,
                                  char[] password)
        Create a new PasswordCredential using a char array as password.
        Parameters:
        username - the user name of the credential.
        password - the password of the credential.
    • Method Detail

      • getPassword

        public char[] getPassword()
        Gets the password.
        Returns:
        the password
      • getUsername

        public java.lang.String getUsername()
        Description copied from interface: UserCredential
        Returns the user name associated with this credential.
        Specified by:
        getUsername in interface UserCredential
        Returns:
        the user name associated with this credential.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object