public static final class ImmutableServerAddress.Builder extends Object
ImmutableServerAddress.
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 |
|---|---|
ImmutableServerAddress |
build()
Builds a new
ImmutableServerAddress. |
ImmutableServerAddress.Builder |
from(ServerAddress instance)
Fill a builder with attribute values from the provided
ServerAddress instance. |
ImmutableServerAddress.Builder |
host(String host)
Initializes the value for the
host attribute. |
ImmutableServerAddress.Builder |
port(int port)
Initializes the value for the
port attribute. |
public final ImmutableServerAddress.Builder from(ServerAddress instance)
ServerAddress 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 invocationpublic final ImmutableServerAddress.Builder host(String host)
host attribute.
If not set, this attribute will have a default value as returned by the initializer of host.
host - The value for hostthis builder for use in a chained invocationpublic final ImmutableServerAddress.Builder port(int port)
port attribute.
If not set, this attribute will have a default value as returned by the initializer of port.
port - The value for portthis builder for use in a chained invocationpublic ImmutableServerAddress build()
ImmutableServerAddress.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.