@NotThreadSafe public static final class ImmutableRaftConfiguration.Builder extends Object
ImmutableRaftConfiguration.
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 |
|---|---|
ImmutableRaftConfiguration.Builder |
addAllServers(Iterable<? extends RaftServer> elements)
Adds elements to
servers list. |
ImmutableRaftConfiguration.Builder |
addServers(RaftServer... elements)
Adds elements to
servers list. |
ImmutableRaftConfiguration.Builder |
addServers(RaftServer element)
Adds one element to
servers list. |
ImmutableRaftConfiguration |
build()
Builds a new
ImmutableRaftConfiguration. |
ImmutableRaftConfiguration.Builder |
from(RaftConfiguration instance)
Fill a builder with attribute values from the provided
RaftConfiguration instance. |
ImmutableRaftConfiguration.Builder |
index(BigInteger index)
Initializes the value for the
index attribute. |
ImmutableRaftConfiguration.Builder |
servers(Iterable<? extends RaftServer> elements)
Sets or replaces all elements for
servers list. |
public final ImmutableRaftConfiguration.Builder from(RaftConfiguration instance)
RaftConfiguration 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 ImmutableRaftConfiguration.Builder addServers(RaftServer element)
servers list.element - A servers elementthis builder for use in a chained invocationpublic final ImmutableRaftConfiguration.Builder addServers(RaftServer... elements)
servers list.elements - An array of servers elementsthis builder for use in a chained invocationpublic final ImmutableRaftConfiguration.Builder servers(Iterable<? extends RaftServer> elements)
servers list.elements - An iterable of servers elementsthis builder for use in a chained invocationpublic final ImmutableRaftConfiguration.Builder addAllServers(Iterable<? extends RaftServer> elements)
servers list.elements - An iterable of servers elementsthis builder for use in a chained invocationpublic final ImmutableRaftConfiguration.Builder index(BigInteger index)
index attribute.index - The value for indexthis builder for use in a chained invocationpublic ImmutableRaftConfiguration build()
ImmutableRaftConfiguration.IllegalStateException - if any required attributes are missingCopyright © 2018. All rights reserved.