Class ImmutableMember.Builder

java.lang.Object
org.kiwiproject.consul.model.agent.ImmutableMember.Builder
Enclosing class:
ImmutableMember

public static final class ImmutableMember.Builder extends Object
Builds instances of type ImmutableMember. 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 ImmutableMember.Builder from(Member instance)
      Fill a builder with attribute values from the provided Member instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • name

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

      @CanIgnoreReturnValue public final ImmutableMember.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
    • port

      @CanIgnoreReturnValue public final ImmutableMember.Builder port(int port)
      Initializes the value for the port attribute.
      Parameters:
      port - The value for port
      Returns:
      this builder for use in a chained invocation
    • putTags

      @CanIgnoreReturnValue public final ImmutableMember.Builder putTags(String key, String value)
      Put one entry to the tags map.
      Parameters:
      key - The key in the tags map
      value - The associated value in the tags map
      Returns:
      this builder for use in a chained invocation
    • putTags

      @CanIgnoreReturnValue public final ImmutableMember.Builder putTags(Map.Entry<String,? extends String> entry)
      Put one entry to the tags map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder for use in a chained invocation
    • tags

      @CanIgnoreReturnValue public final ImmutableMember.Builder tags(Map<String,? extends String> entries)
      Sets or replaces all mappings from the specified map as entries for the tags map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the tags map
      Returns:
      this builder for use in a chained invocation
    • putAllTags

      @CanIgnoreReturnValue public final ImmutableMember.Builder putAllTags(Map<String,? extends String> entries)
      Put all mappings from the specified map as entries to tags map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the tags map
      Returns:
      this builder for use in a chained invocation
    • status

      @CanIgnoreReturnValue public final ImmutableMember.Builder status(int status)
      Initializes the value for the status attribute.
      Parameters:
      status - The value for status
      Returns:
      this builder for use in a chained invocation
    • protocolMin

      @CanIgnoreReturnValue public final ImmutableMember.Builder protocolMin(int protocolMin)
      Initializes the value for the protocolMin attribute.
      Parameters:
      protocolMin - The value for protocolMin
      Returns:
      this builder for use in a chained invocation
    • protocolMax

      @CanIgnoreReturnValue public final ImmutableMember.Builder protocolMax(int protocolMax)
      Initializes the value for the protocolMax attribute.
      Parameters:
      protocolMax - The value for protocolMax
      Returns:
      this builder for use in a chained invocation
    • protocolCur

      @CanIgnoreReturnValue public final ImmutableMember.Builder protocolCur(int protocolCur)
      Initializes the value for the protocolCur attribute.
      Parameters:
      protocolCur - The value for protocolCur
      Returns:
      this builder for use in a chained invocation
    • delegateMin

      @CanIgnoreReturnValue public final ImmutableMember.Builder delegateMin(int delegateMin)
      Initializes the value for the delegateMin attribute.
      Parameters:
      delegateMin - The value for delegateMin
      Returns:
      this builder for use in a chained invocation
    • delegateMax

      @CanIgnoreReturnValue public final ImmutableMember.Builder delegateMax(int delegateMax)
      Initializes the value for the delegateMax attribute.
      Parameters:
      delegateMax - The value for delegateMax
      Returns:
      this builder for use in a chained invocation
    • delegateCur

      @CanIgnoreReturnValue public final ImmutableMember.Builder delegateCur(int delegateCur)
      Initializes the value for the delegateCur attribute.
      Parameters:
      delegateCur - The value for delegateCur
      Returns:
      this builder for use in a chained invocation
    • build

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