public class UserCredentials extends CredentialsInfo
EMPTY, PASSWORD, USERNAME, USERNAME_PASSWORD
Constructor and Description |
---|
UserCredentials(Collection<Field> fields)
Creates a new UserCredentials object which requires the given fields but
does not yet have any defined values.
|
UserCredentials(Collection<Field> fields,
Map<String,String> values)
Creates a new UserCredentials object which requires the given fields and
values.
|
UserCredentials(CredentialsInfo info)
Creates a new UserCredentials object which requires fields described by
the given CredentialsInfo but does not yet have any defined values.
|
UserCredentials(CredentialsInfo info,
Map<String,String> values)
Creates a new UserCredentials object which requires fields described by
the given CredentialsInfo.
|
Modifier and Type | Method and Description |
---|---|
String |
getValue(Field field)
Returns the value defined by this UserCrendentials object for the given
field.
|
String |
getValue(String name)
Returns the value defined by this UserCrendentials object for the field
having the given name.
|
Map<String,String> |
getValues()
Returns a map of field names to values which backs this UserCredentials
object.
|
String |
removeValue(Field field)
Removes (undefines) the value of the given field returning its previous
value.
|
String |
removeValue(String name)
Removes (undefines) the value of the field having the given name,
returning its previous value.
|
String |
setValue(Field field,
String value)
Sets the value of the given field.
|
String |
setValue(String name,
String value)
Sets the value of the field having the given name.
|
void |
setValues(Map<String,String> values)
Replaces the map backing this UserCredentials object with the given map.
|
getFields
public UserCredentials(Collection<Field> fields, Map<String,String> values)
fields
- The fields to require.values
- The values required for each field, as a map of field name to
correct value.public UserCredentials(CredentialsInfo info, Map<String,String> values)
info
- The CredentialsInfo object describing the fields to require.values
- The values required for each field, as a map of field name to
correct value.public UserCredentials(CredentialsInfo info)
info
- The CredentialsInfo object describing the fields to require.public UserCredentials(Collection<Field> fields)
fields
- The fields to require.public Map<String,String> getValues()
public void setValues(Map<String,String> values)
values
- The map of field names to their corresponding values which should be
used to back this UserCredentials object.public String getValue(String name)
name
- The name of the field whose value should be returned.public String getValue(Field field)
field
- The field whose value should be returned.public String setValue(String name, String value)
name
- The name of the field whose value should be assigned.value
- The value to assign to the field having the given name.public String setValue(Field field, String value)
field
- The field whose value should be assigned.value
- The value to assign to the given field.public String removeValue(String name)
name
- The name of the field whose value should be removed.public String removeValue(Field field)
field
- The field whose value should be removed.Copyright © 2016. All rights reserved.