@NotThreadSafe public static final class OptionGroup.Builder extends Object
OptionGroup.
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 |
|---|---|
OptionGroup.Builder |
addAllOptions(Iterable<? extends Option> elements)
Adds elements to
options list. |
OptionGroup.Builder |
addOptions(Option... elements)
Adds elements to
options list. |
OptionGroup.Builder |
addOptions(Option element)
Adds one element to
options list. |
OptionGroup |
build()
Builds a new
OptionGroup. |
OptionGroup.Builder |
from(OptionGroupIF instance)
Fill a builder with attribute values from the provided
OptionGroupIF instance. |
OptionGroup.Builder |
setLabel(Text label)
Initializes the value for the
label attribute. |
OptionGroup.Builder |
setOptions(Iterable<? extends Option> elements)
Sets or replaces all elements for
options list. |
public final OptionGroup.Builder from(OptionGroupIF instance)
OptionGroupIF 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 OptionGroup.Builder setLabel(Text label)
label attribute.label - The value for labelthis builder for use in a chained invocationpublic final OptionGroup.Builder addOptions(Option element)
options list.element - A options elementthis builder for use in a chained invocationpublic final OptionGroup.Builder addOptions(Option... elements)
options list.elements - An array of options elementsthis builder for use in a chained invocationpublic final OptionGroup.Builder setOptions(Iterable<? extends Option> elements)
options list.elements - An iterable of options elementsthis builder for use in a chained invocationpublic final OptionGroup.Builder addAllOptions(Iterable<? extends Option> elements)
options list.elements - An iterable of options elementsthis builder for use in a chained invocationpublic OptionGroup build() throws com.hubspot.immutables.validation.InvalidImmutableStateException
OptionGroup.com.hubspot.immutables.validation.InvalidImmutableStateException - if any required attributes are missingCopyright © 2019. All rights reserved.