Class ImmutableNode.Builder
java.lang.Object
org.kiwiproject.consul.model.health.ImmutableNode.Builder
- Enclosing class:
- ImmutableNode
Builds instances of type
ImmutableNode.
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.
-
Method Summary
Modifier and TypeMethodDescriptionfinal ImmutableNode.BuilderInitializes the value for theaddressattribute.build()Builds a newImmutableNode.final ImmutableNode.Builderdatacenter(String datacenter) Initializes the optional valuedatacenterto datacenter.final ImmutableNode.Builderdatacenter(Optional<String> datacenter) Initializes the optional valuedatacenterto datacenter.final ImmutableNode.BuilderFill a builder with attribute values from the providedNodeinstance.final ImmutableNode.BuilderInitializes the value for thenodeattribute.final ImmutableNode.BuilderInitializes the optional valuenodeMetato nodeMeta.final ImmutableNode.BuilderInitializes the optional valuenodeMetato nodeMeta.final ImmutableNode.BuildertaggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.final ImmutableNode.BuildertaggedAddresses(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.
-
Method Details
-
from
Fill a builder with attribute values from the providedNodeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
node
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
address
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
datacenter
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for use in a chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableNode.Builder taggedAddresses(TaggedAddresses taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.- Parameters:
taggedAddresses- The value for taggedAddresses- Returns:
thisbuilder for chained invocation
-
taggedAddresses
@CanIgnoreReturnValue public final ImmutableNode.Builder taggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses) Initializes the optional valuetaggedAddressesto taggedAddresses.- Parameters:
taggedAddresses- The value for taggedAddresses- Returns:
thisbuilder for use in a chained invocation
-
nodeMeta
Initializes the optional valuenodeMetato nodeMeta.- Parameters:
nodeMeta- The value for nodeMeta- Returns:
thisbuilder for chained invocation
-
nodeMeta
@CanIgnoreReturnValue public final ImmutableNode.Builder nodeMeta(Optional<? extends Map<String, String>> nodeMeta) Initializes the optional valuenodeMetato nodeMeta.- Parameters:
nodeMeta- The value for nodeMeta- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableNode.- Returns:
- An immutable instance of Node
- Throws:
IllegalStateException- if any required attributes are missing
-