@Immutable public class BasicAuthClientCredentials extends Object implements Serializable
| Constructor and Description |
|---|
BasicAuthClientCredentials(String sUserName)
Create credentials with a user name only and no password.
|
BasicAuthClientCredentials(String sUserName,
String sPassword)
Create credentials with a user name and a password.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getPassword() |
String |
getRequestValue()
Create the request HTTP header value for use with the
CHttpHeader.AUTHORIZATION header name. |
String |
getUserName() |
int |
hashCode() |
boolean |
hasPassword() |
String |
toString() |
public BasicAuthClientCredentials(@Nonnull @Nonempty String sUserName)
sUserName - The user name to use. May neither be null nor empty.public BasicAuthClientCredentials(@Nonnull @Nonempty String sUserName, @Nullable String sPassword)
sUserName - The user name to use. May neither be null nor empty.sPassword - The password to use. May be null or empty to indicate
that no password is present.@Nonnull @Nonempty public String getUserName()
null nor empty.public boolean hasPassword()
true if a non-null non-empty password is
present.@Nonnull @Nonempty public String getRequestValue()
CHttpHeader.AUTHORIZATION header name.null nor empty.Copyright © 2016–2019 Philip Helger. All rights reserved.