Package com.rapid7.appspider.models
Class AuthenticationModel
- java.lang.Object
-
- com.rapid7.appspider.models.AuthenticationModel
-
public class AuthenticationModel extends Object
Storage class containing all the information need to authenticate
-
-
Constructor Summary
Constructors Constructor Description AuthenticationModel(String username, String password)
instantiates a new instance of theAuthenticationModel
class with no client IdAuthenticationModel(String username, String password, String clientId)
instantiates a new instance of theAuthenticationModel
class ensuring that username and password are both non-null and non-empty
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthenticationModel
createInstanceOrThrow(String username, String password, String clientId)
String
getClientId()
Gets the client id if present; otherwise throws aNoSuchElementException
String
getPassword()
gets the password valueString
getUsername()
Get the username valueboolean
hasClientId()
Returns whether this object contains a clientId or not
-
-
-
Method Detail
-
createInstanceOrThrow
public static AuthenticationModel createInstanceOrThrow(String username, String password, String clientId)
-
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 notshould 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 aNoSuchElementException
- Returns:
- the client Id if present
- Throws:
NoSuchElementException
- if this instance does not have a clientId
-
-