@NotThreadSafe public static final class ImmutableConfig.Builder extends Object
ImmutableConfig.
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 |
|---|---|
ImmutableConfig |
build()
Builds a new
ImmutableConfig. |
ImmutableConfig.Builder |
datacenter(String datacenter)
Initializes the value for the
datacenter attribute. |
ImmutableConfig.Builder |
from(Config instance)
Fill a builder with attribute values from the provided
Config instance. |
ImmutableConfig.Builder |
nodeName(String nodeName)
Initializes the value for the
nodeName attribute. |
ImmutableConfig.Builder |
revision(String revision)
Initializes the value for the
revision attribute. |
ImmutableConfig.Builder |
server(boolean server)
Initializes the value for the
server attribute. |
ImmutableConfig.Builder |
version(String version)
Initializes the value for the
version attribute. |
@CanIgnoreReturnValue public final ImmutableConfig.Builder from(Config instance)
Config instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableConfig.Builder datacenter(String datacenter)
datacenter attribute.datacenter - The value for datacenterthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableConfig.Builder nodeName(String nodeName)
nodeName attribute.nodeName - The value for nodeNamethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableConfig.Builder revision(String revision)
revision attribute.revision - The value for revisionthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableConfig.Builder server(boolean server)
server attribute.server - The value for serverthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableConfig.Builder version(String version)
version attribute.version - The value for versionthis builder for use in a chained invocationpublic ImmutableConfig build()
ImmutableConfig.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.