public final class Credentials extends Object
Constructor and Description |
---|
Credentials()
Create a Credentials object with no user name and password set.
|
Credentials(String username,
String password)
Create a Credentials object with specified user name and password.
|
Modifier and Type | Method and Description |
---|---|
Object |
attach(Object attachment)
Attaches the given object to the Credentials.
|
Object |
attachment()
Retrieves the current attachment.
|
String |
getPassword()
Returns the Password.
|
String |
getUsername()
Returns the User Name.
|
void |
setPassword(String password)
Sets the Password.
|
void |
setUsername(String username)
Sets the User Name.
|
String |
toString() |
public Credentials()
public Object attach(Object attachment)
An attached object may later be retrieved via the attachment
method. Only one object may be attached at a time; invoking
this method causes any previous attachment to be discarded. The current
attachment may be discarded by attaching null.
attachment
- The object to be attached; may be nullpublic Object attachment()
public String getUsername()
If the client has sent credentials, then this will be either the username or an empty string if the username was not given.
public String getPassword()
If the client has sent credentials, then this will be either the password or an empty string if the password was not given.
public void setUsername(String username)
username
- the User Name.public void setPassword(String password)
password
- the Password.public String toString()
toString
in class Object
Object.toString()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.