public static class DefaultAccount.AccountBuilder extends Object implements Account.Builder
DefaultAccount.AccountBuilder
implementationConstructor and Description |
---|
AccountBuilder(String id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Account |
build()
Build Account instance
|
Account.Builder |
credentials(Credentials credentials)
Set Account credentials as a
Credentials object |
Account.Builder |
credentials(Object credentials)
Set Account credentials
|
Account.Builder |
details(Map<String,Object> details)
Set Account details.
|
Account.Builder |
enabled(boolean enabled)
Set whether is enabled (default is
true ) |
Account.Builder |
expired(boolean expired)
Set whether has expired
|
Account.Builder |
locked(boolean locked)
Set whether is locked
|
Account.Builder |
permissions(Collection<Permission> permissions)
Set permissions granted to Account.
|
Account.Builder |
permissionStrings(Collection<String> permissions)
Set permissions granted to Account using String representations.
|
Account.Builder |
root(boolean root)
Set whether Account is considered a
root principal, for which permission checking is always
skipped, assuming that any permission is granted. |
Account.Builder |
withDetail(String key,
Object value)
Add (or replace if given key already exists) an Account detail
|
Account.Builder |
withPermission(Permission permission)
Add a permission granted to Account
|
Account.Builder |
withPermission(String permission)
Add a permission granted to Account using String representation.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
detail, detail, permission, permission, permissionStrings, withDetail
public AccountBuilder(String id)
id
- Account idpublic Account.Builder root(boolean root)
Account.Builder
root
principal, for which permission checking is always
skipped, assuming that any permission is granted.root
in interface Account.Builder
root
- true
to set Account as root
principalpublic Account.Builder details(Map<String,Object> details)
Account.Builder
details
in interface Account.Builder
details
- the details to setpublic Account.Builder withDetail(String key, Object value)
Account.Builder
withDetail
in interface Account.Builder
key
- Keyvalue
- Valuepublic Account.Builder permissions(Collection<Permission> permissions)
Account.Builder
permissions
in interface Account.Builder
permissions
- the permissions to setpublic Account.Builder withPermission(Permission permission)
Account.Builder
withPermission
in interface Account.Builder
permission
- Permission to addpublic Account.Builder permissionStrings(Collection<String> permissions)
Account.Builder
permissionStrings
in interface Account.Builder
permissions
- the permissions strings to setpublic Account.Builder withPermission(String permission)
Account.Builder
withPermission
in interface Account.Builder
permission
- Permission string to addpublic Account.Builder enabled(boolean enabled)
Account.Builder
true
)enabled
in interface Account.Builder
enabled
- true
if enabledpublic Account.Builder locked(boolean locked)
Account.Builder
locked
in interface Account.Builder
locked
- true
if lockedpublic Account.Builder expired(boolean expired)
Account.Builder
expired
in interface Account.Builder
expired
- true
if expiredpublic Account.Builder credentials(Credentials credentials)
Account.Builder
Credentials
objectcredentials
in interface Account.Builder
credentials
- Credentials to setCredentials.builder()
public Account.Builder credentials(Object credentials)
Account.Builder
credentials
in interface Account.Builder
credentials
- Credentials to setpublic Account build()
Account.Builder
build
in interface Account.Builder
Copyright © 2019 The Holon Platform. All rights reserved.