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 theAuthenticationModelclass with no client IdAuthenticationModel(String username, String password, String clientId)instantiates a new instance of theAuthenticationModelclass 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 AuthenticationModelcreateInstanceOrThrow(String username, String password, String clientId)StringgetClientId()Gets the client id if present; otherwise throws aNoSuchElementExceptionStringgetPassword()gets the password valueStringgetUsername()Get the username valuebooleanhasClientId()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
getClientIdto 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
-
-