public class LongTermCredential extends Object
Modifier and Type | Field and Description |
---|---|
private byte[] |
password
The password of this LongTermCredential.
|
private byte[] |
username
The username of this LongTermCredential.
|
Modifier | Constructor and Description |
---|---|
protected |
LongTermCredential()
Initializes a new LongTermCredential instance with no username
and no password.
|
|
LongTermCredential(byte[] username,
byte[] password)
Initializes a new LongTermCredential instance with a specific
username and a specific password.
|
|
LongTermCredential(String username,
String password)
Initializes a new LongTermCredential instance with a specific
username and a specific password.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static byte[] |
getBytes(String s)
Encodes a specific String into a sequence of bytes
using the UTF-8 charset, storing the result into a new byte
array.
|
byte[] |
getPassword()
Gets the password of this LongTermCredential.
|
byte[] |
getUsername()
Gets the username of this LongTermCredential.
|
int |
hashCode() |
static String |
toString(byte[] bytes)
Constructs a new String by decoding a specific array of
bytes using the UTF-8 charset.
|
private final byte[] password
private final byte[] username
protected LongTermCredential()
getUsername()
and
getPassword()
to provide the username and the password,
respectively, when requested.public LongTermCredential(byte[] username, byte[] password)
username
- the username to initialize the new instance withpassword
- the password to initialize the new instance withpublic LongTermCredential(String username, String password)
username
- the username to initialize the new instance withpassword
- the password to initialize the new instance withpublic static byte[] getBytes(String s)
s
- the String to encodepublic static String toString(byte[] bytes)
bytes
- the bytes to be decoded into characterspublic byte[] getPassword()
public byte[] getUsername()
Copyright © 2018. All rights reserved.