public static final class UserConfig.Builder extends Object
UserConfig.
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 |
|---|---|
UserConfig.Builder |
addAllDefaultGroups(Iterable<String> elements)
Adds elements to
defaultGroups list. |
UserConfig |
build()
Builds a new
UserConfig. |
UserConfig.Builder |
defaultGroup(String element)
Adds one element to
defaultGroups list. |
UserConfig.Builder |
defaultGroups(Iterable<String> elements)
Sets or replaces all elements for
defaultGroups list. |
UserConfig.Builder |
defaultGroups(String... elements)
Adds elements to
defaultGroups list. |
UserConfig.Builder |
from(UserConfig instance)
Fill a builder with attribute values from the provided
UserConfig instance. |
public final UserConfig.Builder from(UserConfig instance)
UserConfig 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 UserConfig.Builder defaultGroup(String element)
defaultGroups list.element - A defaultGroups elementthis builder for use in a chained invocationpublic final UserConfig.Builder defaultGroups(String... elements)
defaultGroups list.elements - An array of defaultGroups elementsthis builder for use in a chained invocationpublic final UserConfig.Builder defaultGroups(Iterable<String> elements)
defaultGroups list.elements - An iterable of defaultGroups elementsthis builder for use in a chained invocationpublic final UserConfig.Builder addAllDefaultGroups(Iterable<String> elements)
defaultGroups list.elements - An iterable of defaultGroups elementsthis builder for use in a chained invocationpublic UserConfig build()
UserConfig.IllegalStateException - if any required attributes are missingCopyright © 2020. All rights reserved.