Class AuthenticationModel


  • public class AuthenticationModel
    extends Object
    Storage class containing all the information need to authenticate
    • Constructor Detail

      • AuthenticationModel

        public AuthenticationModel​(String username,
                                   String password)
        instantiates a new instance of the AuthenticationModel class with no client Id
      • AuthenticationModel

        public AuthenticationModel​(String username,
                                   String password,
                                   String clientId)
        instantiates a new instance of the AuthenticationModel class ensuring that username and password are both non-null and non-empty
    • Method Detail

      • getPassword

        public String getPassword()
        gets the password value
        Returns:
        password as a Secret
      • getUsername

        public String getUsername()
        Get the username value
        Returns:
        username as a String
      • hasClientId

        public boolean hasClientId()
        Returns whether this object contains a clientId or not

        should be called prior to getClientId to ensure a value is present, otherwise an exception may occur

        Returns:
        true if client id is set; otherwise, false
      • getClientId

        public String getClientId()
                           throws NoSuchElementException
        Gets the client id if present; otherwise throws a NoSuchElementException
        Returns:
        the client Id if present
        Throws:
        NoSuchElementException - if this instance does not have a clientId