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