public static final class ImmutableUser.Builder extends Object
ImmutableUser.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
ImmutableUser.Builder |
addAllRoles(Iterable<String> elements)
Adds elements to
roles list. |
ImmutableUser.Builder |
addRoles(String... elements)
Adds elements to
roles list. |
ImmutableUser.Builder |
addRoles(String element)
Adds one element to
roles list. |
ImmutableUser |
build()
Builds a new
ImmutableUser. |
ImmutableUser.Builder |
database(String database)
Initializes the value for the
database attribute. |
ImmutableUser.Builder |
from(AuthenticationSetup.User instance)
Fill a builder with attribute values from the provided
User instance. |
ImmutableUser.Builder |
roles(Iterable<String> elements)
Sets or replaces all elements for
roles list. |
ImmutableUser.Builder |
user(UsernamePassword user)
Initializes the value for the
user attribute. |
public final ImmutableUser.Builder from(AuthenticationSetup.User instance)
User instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.
Collection elements and entries will be added, not replaced.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableUser.Builder database(String database)
database attribute.database - The value for databasethis builder for use in a chained invocationpublic final ImmutableUser.Builder user(UsernamePassword user)
user attribute.user - The value for userthis builder for use in a chained invocationpublic final ImmutableUser.Builder addRoles(String element)
roles list.element - A roles elementthis builder for use in a chained invocationpublic final ImmutableUser.Builder addRoles(String... elements)
roles list.elements - An array of roles elementsthis builder for use in a chained invocationpublic final ImmutableUser.Builder roles(Iterable<String> elements)
roles list.elements - An iterable of roles elementsthis builder for use in a chained invocationpublic final ImmutableUser.Builder addAllRoles(Iterable<String> elements)
roles list.elements - An iterable of roles elementsthis builder for use in a chained invocationpublic ImmutableUser build()
ImmutableUser.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.