Class ImmutableNode.Builder

java.lang.Object
org.kiwiproject.consul.model.health.ImmutableNode.Builder
Enclosing class:
ImmutableNode

public static final class ImmutableNode.Builder extends Object
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 Details

    • from

      @CanIgnoreReturnValue public final ImmutableNode.Builder from(Node instance)
      Fill a builder with attribute values from the provided Node instance. 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:
      this builder for use in a chained invocation
    • node

      @CanIgnoreReturnValue public final ImmutableNode.Builder node(String node)
      Initializes the value for the node attribute.
      Parameters:
      node - The value for node
      Returns:
      this builder for use in a chained invocation
    • address

      @CanIgnoreReturnValue public final ImmutableNode.Builder address(String address)
      Initializes the value for the address attribute.
      Parameters:
      address - The value for address
      Returns:
      this builder for use in a chained invocation
    • datacenter

      @CanIgnoreReturnValue public final ImmutableNode.Builder datacenter(String datacenter)
      Initializes the optional value datacenter to datacenter.
      Parameters:
      datacenter - The value for datacenter
      Returns:
      this builder for chained invocation
    • datacenter

      @CanIgnoreReturnValue public final ImmutableNode.Builder datacenter(Optional<String> datacenter)
      Initializes the optional value datacenter to datacenter.
      Parameters:
      datacenter - The value for datacenter
      Returns:
      this builder for use in a chained invocation
    • taggedAddresses

      @CanIgnoreReturnValue public final ImmutableNode.Builder taggedAddresses(TaggedAddresses taggedAddresses)
      Initializes the optional value taggedAddresses to taggedAddresses.
      Parameters:
      taggedAddresses - The value for taggedAddresses
      Returns:
      this builder for chained invocation
    • taggedAddresses

      @CanIgnoreReturnValue public final ImmutableNode.Builder taggedAddresses(Optional<? extends TaggedAddresses> taggedAddresses)
      Initializes the optional value taggedAddresses to taggedAddresses.
      Parameters:
      taggedAddresses - The value for taggedAddresses
      Returns:
      this builder for use in a chained invocation
    • nodeMeta

      @CanIgnoreReturnValue public final ImmutableNode.Builder nodeMeta(Map<String,String> nodeMeta)
      Initializes the optional value nodeMeta to nodeMeta.
      Parameters:
      nodeMeta - The value for nodeMeta
      Returns:
      this builder for chained invocation
    • nodeMeta

      @CanIgnoreReturnValue public final ImmutableNode.Builder nodeMeta(Optional<? extends Map<String,String>> nodeMeta)
      Initializes the optional value nodeMeta to nodeMeta.
      Parameters:
      nodeMeta - The value for nodeMeta
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableNode build()
      Builds a new ImmutableNode.
      Returns:
      An immutable instance of Node
      Throws:
      IllegalStateException - if any required attributes are missing