public abstract class AbstractCredentials extends Object implements Credentials
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
attributes |
protected String |
userId |
| Constructor and Description |
|---|
AbstractCredentials(String userId) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name)
Returns the value of the named attribute as an
Object, or
null if no attribute of the given name exists. |
Map<String,Object> |
getAttributes() |
String |
getUserId()
Returns the userId.
|
void |
removeAttribute(String name)
Removes an attribute from this credentials instance.
|
void |
setAttribute(String name,
Object value)
Stores an attribute in this credentials instance.
|
void |
setAttributes(Map<String,Object> attributes)
Stores the attributes in this credentials instance.
|
protected final String userId
public void setAttribute(@Nonnull String name, @Nullable Object value)
value is null the attribute will be removed.name - a String specifying the name of the attributevalue - the Object to be stored@CheckForNull public Object getAttribute(@Nonnull String name)
Object, or
null if no attribute of the given name exists.name - a String specifying the name of the attributeObject containing the value of the attribute, or
null if the attribute does not existpublic void removeAttribute(@Nonnull String name)
name - a String specifying the name of the attribute to
remove@Nonnull public Map<String,Object> getAttributes()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.