@NotThreadSafe public static final class ImmutableGroup.Builder extends Object
ImmutableGroup.
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 |
|---|---|
ImmutableGroup.Builder |
addAllItems(Iterable<? extends Plugin.Item> elements)
Adds elements to
items list. |
ImmutableGroup.Builder |
addItems(Plugin.Item... elements)
Adds elements to
items list. |
ImmutableGroup.Builder |
addItems(Plugin.Item element)
Adds one element to
items list. |
ImmutableGroup |
build()
Builds a new
ImmutableGroup. |
ImmutableGroup.Builder |
from(Plugin.Group instance)
Fill a builder with attribute values from the provided
Group instance. |
ImmutableGroup.Builder |
items(Iterable<? extends Plugin.Item> elements)
Sets or replaces all elements for
items list. |
ImmutableGroup.Builder |
name(String name)
Initializes the value for the
name attribute. |
@CanIgnoreReturnValue public final ImmutableGroup.Builder from(Plugin.Group instance)
Group 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 invocation@CanIgnoreReturnValue public final ImmutableGroup.Builder name(String name)
name attribute.name - The value for namethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGroup.Builder addItems(Plugin.Item element)
items list.element - A items elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGroup.Builder addItems(Plugin.Item... elements)
items list.elements - An array of items elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGroup.Builder items(Iterable<? extends Plugin.Item> elements)
items list.elements - An iterable of items elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableGroup.Builder addAllItems(Iterable<? extends Plugin.Item> elements)
items list.elements - An iterable of items elementsthis builder for use in a chained invocationpublic ImmutableGroup build()
ImmutableGroup.IllegalStateException - if any required attributes are missingCopyright © 2016–2025. All rights reserved.