Modifier and Type | Method and Description |
---|---|
User.UserBuilder |
accountExpired(boolean accountExpired)
Defines if the account is expired or not.
|
User.UserBuilder |
accountLocked(boolean accountLocked)
Defines if the account is locked or not.
|
User.UserBuilder |
authorities(Collection<? extends GrantedAuthority> authorities)
Populates the authorities.
|
User.UserBuilder |
authorities(GrantedAuthority... authorities)
Populates the authorities.
|
User.UserBuilder |
authorities(String... authorities)
Populates the authorities.
|
UserDetails |
build() |
User.UserBuilder |
credentialsExpired(boolean credentialsExpired)
Defines if the credentials are expired or not.
|
User.UserBuilder |
disabled(boolean disabled)
Defines if the account is disabled or not.
|
User.UserBuilder |
password(String password)
Populates the password.
|
User.UserBuilder |
roles(String... roles)
Populates the roles.
|
User.UserBuilder |
username(String username)
Populates the username.
|
public User.UserBuilder username(String username)
username
- the username. Cannot be null.User.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder password(String password)
password
- the password. Cannot be null.User.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder roles(String... roles)
authorities(String...)
, but automatically prefixes each entry with
"ROLE_". This means the following:
builder.roles("USER","ADMIN");
is equivalent to
builder.authorities("ROLE_USER","ROLE_ADMIN");
This attribute is required, but can also be populated with
authorities(String...)
.
roles
- the roles for this user (i.e. USER, ADMIN, etc). Cannot be null,
contain null values or start with "ROLE_"User.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder authorities(GrantedAuthority... authorities)
authorities
- the authorities for this user. Cannot be null, or contain
null valuesUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)roles(String...)
public User.UserBuilder authorities(Collection<? extends GrantedAuthority> authorities)
authorities
- the authorities for this user. Cannot be null, or contain
null valuesUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)roles(String...)
public User.UserBuilder authorities(String... authorities)
authorities
- the authorities for this user (i.e. ROLE_USER, ROLE_ADMIN,
etc). Cannot be null, or contain null valuesUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)roles(String...)
public User.UserBuilder accountExpired(boolean accountExpired)
accountExpired
- true if the account is expired, false otherwiseUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder accountLocked(boolean accountLocked)
accountLocked
- true if the account is locked, false otherwiseUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder credentialsExpired(boolean credentialsExpired)
credentialsExpired
- true if the credentials are expired, false otherwiseUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public User.UserBuilder disabled(boolean disabled)
disabled
- true if the account is disabled, false otherwiseUser.UserBuilder
for method chaining (i.e. to populate
additional attributes for this user)public UserDetails build()