Class ImmutableCatalogService

java.lang.Object
org.kiwiproject.consul.model.catalog.CatalogService
org.kiwiproject.consul.model.catalog.ImmutableCatalogService

@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableCatalogService extends CatalogService
Immutable implementation of CatalogService.

Use the builder to create immutable instances: ImmutableCatalogService.builder().

  • Method Details

    • getNode

      public String getNode()
      Specified by:
      getNode in class CatalogService
      Returns:
      The value of the node attribute
    • getAddress

      public String getAddress()
      Specified by:
      getAddress in class CatalogService
      Returns:
      The value of the address attribute
    • getDatacenter

      public Optional<String> getDatacenter()
      Specified by:
      getDatacenter in class CatalogService
      Returns:
      The value of the datacenter attribute
    • getServiceName

      public String getServiceName()
      Specified by:
      getServiceName in class CatalogService
      Returns:
      The value of the serviceName attribute
    • getServiceId

      public String getServiceId()
      Specified by:
      getServiceId in class CatalogService
      Returns:
      The value of the serviceId attribute
    • getServiceAddress

      public String getServiceAddress()
      Specified by:
      getServiceAddress in class CatalogService
      Returns:
      The value of the serviceAddress attribute
    • getServiceEnableTagOverride

      public Optional<Boolean> getServiceEnableTagOverride()
      Specified by:
      getServiceEnableTagOverride in class CatalogService
      Returns:
      The value of the serviceEnableTagOverride attribute
    • getServicePort

      public int getServicePort()
      Specified by:
      getServicePort in class CatalogService
      Returns:
      The value of the servicePort attribute
    • getServiceTags

      public com.google.common.collect.ImmutableList<String> getServiceTags()
      Specified by:
      getServiceTags in class CatalogService
      Returns:
      The value of the serviceTags attribute
    • getServiceMeta

      public com.google.common.collect.ImmutableMap<String,String> getServiceMeta()
      Specified by:
      getServiceMeta in class CatalogService
      Returns:
      The value of the serviceMeta attribute
    • getServiceWeights

      public Optional<ServiceWeights> getServiceWeights()
      Specified by:
      getServiceWeights in class CatalogService
      Returns:
      The value of the serviceWeights attribute
    • getNodeMeta

      public com.google.common.collect.ImmutableMap<String,String> getNodeMeta()
      Specified by:
      getNodeMeta in class CatalogService
      Returns:
      The value of the nodeMeta attribute
    • withNode

      public final ImmutableCatalogService withNode(String value)
      Copy the current immutable object by setting a value for the node attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for node
      Returns:
      A modified copy of the this object
    • withAddress

      public final ImmutableCatalogService withAddress(String value)
      Copy the current immutable object by setting a value for the address attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for address
      Returns:
      A modified copy of the this object
    • withDatacenter

      public final ImmutableCatalogService withDatacenter(String value)
      Copy the current immutable object by setting a present value for the optional datacenter attribute.
      Parameters:
      value - The value for datacenter
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableCatalogService withDatacenter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the datacenter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for datacenter
      Returns:
      A modified copy of this object
    • withServiceName

      public final ImmutableCatalogService withServiceName(String value)
      Copy the current immutable object by setting a value for the serviceName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for serviceName
      Returns:
      A modified copy of the this object
    • withServiceId

      public final ImmutableCatalogService withServiceId(String value)
      Copy the current immutable object by setting a value for the serviceId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for serviceId
      Returns:
      A modified copy of the this object
    • withServiceAddress

      public final ImmutableCatalogService withServiceAddress(String value)
      Copy the current immutable object by setting a value for the serviceAddress attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for serviceAddress
      Returns:
      A modified copy of the this object
    • withServiceEnableTagOverride

      public final ImmutableCatalogService withServiceEnableTagOverride(boolean value)
      Copy the current immutable object by setting a present value for the optional serviceEnableTagOverride attribute.
      Parameters:
      value - The value for serviceEnableTagOverride
      Returns:
      A modified copy of this object
    • withServiceEnableTagOverride

      public final ImmutableCatalogService withServiceEnableTagOverride(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the serviceEnableTagOverride attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for serviceEnableTagOverride
      Returns:
      A modified copy of this object
    • withServicePort

      public final ImmutableCatalogService withServicePort(int value)
      Copy the current immutable object by setting a value for the servicePort attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for servicePort
      Returns:
      A modified copy of the this object
    • withServiceTags

      public final ImmutableCatalogService withServiceTags(String... elements)
      Copy the current immutable object with elements that replace the content of serviceTags.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withServiceTags

      public final ImmutableCatalogService withServiceTags(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of serviceTags. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of serviceTags elements to set
      Returns:
      A modified copy of this object
    • withServiceMeta

      public final ImmutableCatalogService withServiceMeta(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the serviceMeta map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the serviceMeta map
      Returns:
      A modified copy of this object
    • withServiceWeights

      public final ImmutableCatalogService withServiceWeights(ServiceWeights value)
      Copy the current immutable object by setting a present value for the optional serviceWeights attribute.
      Parameters:
      value - The value for serviceWeights
      Returns:
      A modified copy of this object
    • withServiceWeights

      public final ImmutableCatalogService withServiceWeights(Optional<? extends ServiceWeights> optional)
      Copy the current immutable object by setting an optional value for the serviceWeights attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for serviceWeights
      Returns:
      A modified copy of this object
    • withNodeMeta

      public final ImmutableCatalogService withNodeMeta(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the nodeMeta map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the nodeMeta map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableCatalogService that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: node, address, datacenter, serviceName, serviceId, serviceAddress, serviceEnableTagOverride, servicePort, serviceTags, serviceMeta, serviceWeights, nodeMeta.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value CatalogService with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableCatalogService copyOf(CatalogService instance)
      Creates an immutable copy of a CatalogService value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable CatalogService instance
    • builder

      public static ImmutableCatalogService.Builder builder()
      Creates a builder for ImmutableCatalogService.
       ImmutableCatalogService.builder()
          .node(String) // required node
          .address(String) // required address
          .datacenter(String) // optional datacenter
          .serviceName(String) // required serviceName
          .serviceId(String) // required serviceId
          .serviceAddress(String) // required serviceAddress
          .serviceEnableTagOverride(Boolean) // optional serviceEnableTagOverride
          .servicePort(int) // required servicePort
          .addServiceTags|addAllServiceTags(String) // serviceTags elements
          .putServiceMeta|putAllServiceMeta(String => String) // serviceMeta mappings
          .serviceWeights(org.kiwiproject.consul.model.catalog.ServiceWeights) // optional serviceWeights
          .putNodeMeta|putAllNodeMeta(String => String) // nodeMeta mappings
          .build();
       
      Returns:
      A new ImmutableCatalogService builder