Package com.orbitz.consul.model.health
Class ImmutableNode.Builder
- java.lang.Object
-
- com.orbitz.consul.model.health.ImmutableNode.Builder
-
- Enclosing class:
- ImmutableNode
@NotThreadSafe public static final class ImmutableNode.Builder extends java.lang.ObjectBuilds instances of typeImmutableNode. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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 Type Method Description ImmutableNode.Builderaddress(java.lang.String address)Initializes the value for theaddressattribute.ImmutableNodebuild()Builds a newImmutableNode.ImmutableNode.Builderdatacenter(java.lang.String datacenter)Initializes the optional valuedatacenterto datacenter.ImmutableNode.Builderdatacenter(java.util.Optional<java.lang.String> datacenter)Initializes the optional valuedatacenterto datacenter.ImmutableNode.Builderfrom(Node instance)Fill a builder with attribute values from the providedNodeinstance.ImmutableNode.Buildernode(java.lang.String node)Initializes the value for thenodeattribute.ImmutableNode.BuildernodeMeta(java.util.Map<java.lang.String,java.lang.String> nodeMeta)Initializes the optional valuenodeMetato nodeMeta.ImmutableNode.BuildernodeMeta(java.util.Optional<? extends java.util.Map<java.lang.String,java.lang.String>> nodeMeta)Initializes the optional valuenodeMetato nodeMeta.ImmutableNode.BuildertaggedAddresses(TaggedAddresses taggedAddresses)Initializes the optional valuetaggedAddressesto taggedAddresses.ImmutableNode.BuildertaggedAddresses(java.util.Optional<? extends TaggedAddresses> taggedAddresses)Initializes the optional valuetaggedAddressesto taggedAddresses.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableNode.Builder from(Node instance)
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
@CanIgnoreReturnValue public final ImmutableNode.Builder node(java.lang.String node)
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
address
@CanIgnoreReturnValue public final ImmutableNode.Builder address(java.lang.String address)
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableNode.Builder datacenter(java.lang.String datacenter)
Initializes the optional valuedatacenterto datacenter.- Parameters:
datacenter- The value for datacenter- Returns:
thisbuilder for chained invocation
-
datacenter
@CanIgnoreReturnValue public final ImmutableNode.Builder datacenter(java.util.Optional<java.lang.String> 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(java.util.Optional<? extends TaggedAddresses> taggedAddresses)
Initializes the optional valuetaggedAddressesto taggedAddresses.- Parameters:
taggedAddresses- The value for taggedAddresses- Returns:
thisbuilder for use in a chained invocation
-
nodeMeta
@CanIgnoreReturnValue public final ImmutableNode.Builder nodeMeta(java.util.Map<java.lang.String,java.lang.String> nodeMeta)
Initializes the optional valuenodeMetato nodeMeta.- Parameters:
nodeMeta- The value for nodeMeta- Returns:
thisbuilder for chained invocation
-
nodeMeta
@CanIgnoreReturnValue public final ImmutableNode.Builder nodeMeta(java.util.Optional<? extends java.util.Map<java.lang.String,java.lang.String>> nodeMeta)
Initializes the optional valuenodeMetato nodeMeta.- Parameters:
nodeMeta- The value for nodeMeta- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableNode build()
Builds a newImmutableNode.- Returns:
- An immutable instance of Node
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-