Class ImmutableCatalogService.Builder

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogService.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 ImmutableCatalogService.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 ImmutableCatalogService.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 ImmutableCatalogService.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
    • serviceName

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

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

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogService.Builder addServiceTags(String element)
      Adds one element to serviceTags list.
      Parameters:
      element - A serviceTags element
      Returns:
      this builder for use in a chained invocation
    • addServiceTags

      @CanIgnoreReturnValue public final ImmutableCatalogService.Builder addServiceTags(String... elements)
      Adds elements to serviceTags list.
      Parameters:
      elements - An array of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • serviceTags

      @CanIgnoreReturnValue public final ImmutableCatalogService.Builder serviceTags(Iterable<String> elements)
      Sets or replaces all elements for serviceTags list.
      Parameters:
      elements - An iterable of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • addAllServiceTags

      @CanIgnoreReturnValue public final ImmutableCatalogService.Builder addAllServiceTags(Iterable<String> elements)
      Adds elements to serviceTags list.
      Parameters:
      elements - An iterable of serviceTags elements
      Returns:
      this builder for use in a chained invocation
    • putServiceMeta

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

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

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

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

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

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

      @CanIgnoreReturnValue public final ImmutableCatalogService.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 ImmutableCatalogService.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 ImmutableCatalogService.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 ImmutableCatalogService.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
    • build

      public ImmutableCatalogService build()
      Returns:
      An immutable instance of CatalogService
      Throws:
      IllegalStateException - if any required attributes are missing