Class ImmutableNode.Builder

  • Enclosing class:
    ImmutableNode

    @NotThreadSafe
    public static final class ImmutableNode.Builder
    extends java.lang.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 Detail

      • 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​(java.lang.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​(java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.util.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​(java.util.Map<java.lang.String,​java.lang.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​(java.util.Optional<? extends java.util.Map<java.lang.String,​java.lang.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:
        java.lang.IllegalStateException - if any required attributes are missing