public class DefaultAccount extends Object implements Account
Account
implementationModifier and Type | Class and Description |
---|---|
static class |
DefaultAccount.AccountBuilder
Default
DefaultAccount.AccountBuilder implementation |
Account.AccountProvider, Account.Builder
CredentialsContainer.CredentialsMatcher
Constructor and Description |
---|
DefaultAccount(String id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
getCredentials()
Account stored credentials data
|
Map<String,Object> |
getDetails()
Optional account details (e.g. user name, surname, language etc.)
|
String |
getId()
Account id (required).
|
Collection<Permission> |
getPermissions()
Optional permissions granted to account
|
int |
hashCode() |
boolean |
isEnabled()
Indicates whether this account is enabled
|
boolean |
isExpired()
Indicates whether this account has expired
|
boolean |
isLocked()
Indicates whether this account is locked
|
boolean |
isRoot()
Whether account is
root , i.e. has any permission. |
void |
setCredentials(Object credentials)
Set account credentials
|
void |
setDetail(String key,
Object value)
Add (or replace if given key already exists) a detail
|
void |
setDetails(Map<String,Object> details)
Set account details
|
void |
setEnabled(boolean enabled)
Set whether is enabled
|
void |
setExpired(boolean expired)
Set whether has expired
|
void |
setLocked(boolean locked)
Set whether is locked
|
void |
setPermissions(Collection<Permission> permissions)
Set account permissions
|
void |
setRoot(boolean root)
Set whether account is
root , i.e. has any permission |
String |
toString() |
accountCredentialsToken, accountCredentialsToken, authenticator, authenticator, builder
defaultMatcher
public DefaultAccount(String id)
id
- Account id (not null)public String getId()
Account
username
if account represents a user.public Object getCredentials()
Account
getCredentials
in interface Account
getCredentials
in interface CredentialsContainer
public boolean isRoot()
Account
root
, i.e. has any permission. If this method returns true,
Account.getPermissions()
is ignored.public Map<String,Object> getDetails()
Account
getDetails
in interface Account
public Collection<Permission> getPermissions()
Account
getPermissions
in interface Account
public boolean isEnabled()
Account
public boolean isLocked()
Account
public boolean isExpired()
Account
public void setRoot(boolean root)
root
, i.e. has any permissionroot
- If true
, getPermissions()
is ignored.public void setCredentials(Object credentials)
credentials
- the credentials to setpublic void setDetails(Map<String,Object> details)
details
- the details to setpublic void setDetail(String key, Object value)
key
- Keyvalue
- Valuepublic void setPermissions(Collection<Permission> permissions)
permissions
- the permissions to setpublic void setEnabled(boolean enabled)
enabled
- true
if enabledpublic void setLocked(boolean locked)
locked
- true
if lockedpublic void setExpired(boolean expired)
expired
- true
if expiredCopyright © 2019 The Holon Platform. All rights reserved.