Modifier and Type | Method and Description |
---|---|
UserInfo |
build()
Builds the user, with the previously given settings.
|
static UserInfo.Builder |
createUser(String id)
Creates a new builder and initializes it with an id for the user.
|
UserInfo.Builder |
withLang(String lang)
Sets the language code of the user.
|
UserInfo.Builder |
withPermissions(Set<String> permissions)
Sets the permissions granted to the user.
|
UserInfo.Builder |
withSettingsSupplier(Function<UserInfo,UserSettings> settingsSupplier)
Sets a config supplier which can provide an individual configuration for the current user.
|
UserInfo.Builder |
withTenantId(String id)
Sets the id of the tenant the user belongs to.
|
UserInfo.Builder |
withTenantName(String name)
Sets the name of the tenant the user belongs to.
|
UserInfo.Builder |
withUsername(String name)
Sets the name of the user.
|
UserInfo.Builder |
withUserSupplier(Function<UserInfo,Object> userSupplier)
Sets a user supplier which returns the underlying user object (e.g. a database entity).
|
@CheckReturnValue public static UserInfo.Builder createUser(@Nonnull String id)
id
- the id of the user to build.public UserInfo.Builder withUsername(String name)
name
- the name of the user.public UserInfo.Builder withTenantId(String id)
id
- the id of the tenantpublic UserInfo.Builder withTenantName(String name)
name
- the name of the tenantpublic UserInfo.Builder withLang(String lang)
lang
- a two-letter language code which should be understood by NLS
.public UserInfo.Builder withPermissions(Set<String> permissions)
permissions
- the set of permissions granted to the userpublic UserInfo.Builder withSettingsSupplier(Function<UserInfo,UserSettings> settingsSupplier)
settingsSupplier
- the function which fetches or computes the configuration for this user on demand.public UserInfo.Builder withUserSupplier(Function<UserInfo,Object> userSupplier)
userSupplier
- the function which fetches or computes the user objectpublic UserInfo build()
Copyright © 2018. All rights reserved.