Class ImmutableCatalogRegistration.Builder

java.lang.Object
org.kiwiproject.consul.model.catalog.ImmutableCatalogRegistration.Builder
Enclosing class:
ImmutableCatalogRegistration

public static final class ImmutableCatalogRegistration.Builder extends Object
Builds instances of type ImmutableCatalogRegistration. 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 ImmutableCatalogRegistration.Builder from(CatalogRegistration instance)
      Fill a builder with attribute values from the provided CatalogRegistration 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
    • id

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogRegistration.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 ImmutableCatalogRegistration.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
    • node

      @CanIgnoreReturnValue public final ImmutableCatalogRegistration.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 ImmutableCatalogRegistration.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
    • putNodeMeta

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogRegistration.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 ImmutableCatalogRegistration.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
    • service

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

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

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

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogRegistration.Builder skipNodeUpdate(Optional<Boolean> skipNodeUpdate)
      Initializes the optional value skipNodeUpdate to skipNodeUpdate.
      Parameters:
      skipNodeUpdate - The value for skipNodeUpdate
      Returns:
      this builder for use in a chained invocation
    • build

      Returns:
      An immutable instance of CatalogRegistration
      Throws:
      IllegalStateException - if any required attributes are missing