Class ImmutableCatalogRegistration

java.lang.Object
org.kiwiproject.consul.model.catalog.CatalogRegistration
org.kiwiproject.consul.model.catalog.ImmutableCatalogRegistration

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

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

  • Method Details

    • id

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

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

      public String node()
      Specified by:
      node in class CatalogRegistration
      Returns:
      The value of the node attribute
    • address

      public String address()
      Specified by:
      address in class CatalogRegistration
      Returns:
      The value of the address attribute
    • nodeMeta

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

      public Optional<TaggedAddresses> taggedAddresses()
      Specified by:
      taggedAddresses in class CatalogRegistration
      Returns:
      The value of the taggedAddresses attribute
    • service

      public Optional<Service> service()
      Specified by:
      service in class CatalogRegistration
      Returns:
      The value of the service attribute
    • check

      public Optional<Check> check()
      Specified by:
      check in class CatalogRegistration
      Returns:
      The value of the check attribute
    • writeRequest

      public Optional<WriteRequest> writeRequest()
      Specified by:
      writeRequest in class CatalogRegistration
      Returns:
      The value of the writeRequest attribute
    • skipNodeUpdate

      public Optional<Boolean> skipNodeUpdate()
      Specified by:
      skipNodeUpdate in class CatalogRegistration
      Returns:
      The value of the skipNodeUpdate attribute
    • withId

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

      public final ImmutableCatalogRegistration withId(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the id 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 id
      Returns:
      A modified copy of this object
    • withDatacenter

      public final ImmutableCatalogRegistration 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 ImmutableCatalogRegistration 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
    • withNode

      public final ImmutableCatalogRegistration 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 ImmutableCatalogRegistration 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
    • withNodeMeta

      public final ImmutableCatalogRegistration 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
    • withTaggedAddresses

      public final ImmutableCatalogRegistration withTaggedAddresses(TaggedAddresses value)
      Copy the current immutable object by setting a present value for the optional taggedAddresses attribute.
      Parameters:
      value - The value for taggedAddresses
      Returns:
      A modified copy of this object
    • withTaggedAddresses

      public final ImmutableCatalogRegistration withTaggedAddresses(Optional<? extends TaggedAddresses> optional)
      Copy the current immutable object by setting an optional value for the taggedAddresses 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 taggedAddresses
      Returns:
      A modified copy of this object
    • withService

      public final ImmutableCatalogRegistration withService(Service value)
      Copy the current immutable object by setting a present value for the optional service attribute.
      Parameters:
      value - The value for service
      Returns:
      A modified copy of this object
    • withService

      public final ImmutableCatalogRegistration withService(Optional<? extends Service> optional)
      Copy the current immutable object by setting an optional value for the service 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 service
      Returns:
      A modified copy of this object
    • withCheck

      public final ImmutableCatalogRegistration withCheck(Check value)
      Copy the current immutable object by setting a present value for the optional check attribute.
      Parameters:
      value - The value for check
      Returns:
      A modified copy of this object
    • withCheck

      public final ImmutableCatalogRegistration withCheck(Optional<? extends Check> optional)
      Copy the current immutable object by setting an optional value for the check 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 check
      Returns:
      A modified copy of this object
    • withWriteRequest

      public final ImmutableCatalogRegistration withWriteRequest(WriteRequest value)
      Copy the current immutable object by setting a present value for the optional writeRequest attribute.
      Parameters:
      value - The value for writeRequest
      Returns:
      A modified copy of this object
    • withWriteRequest

      public final ImmutableCatalogRegistration withWriteRequest(Optional<? extends WriteRequest> optional)
      Copy the current immutable object by setting an optional value for the writeRequest 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 writeRequest
      Returns:
      A modified copy of this object
    • withSkipNodeUpdate

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

      public final ImmutableCatalogRegistration withSkipNodeUpdate(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the skipNodeUpdate 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 skipNodeUpdate
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableCatalogRegistration 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: id, datacenter, node, address, nodeMeta, taggedAddresses, service, check, writeRequest, skipNodeUpdate.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableCatalogRegistration copyOf(CatalogRegistration instance)
      Creates an immutable copy of a CatalogRegistration 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 CatalogRegistration instance
    • builder

      public static ImmutableCatalogRegistration.Builder builder()
      Creates a builder for ImmutableCatalogRegistration.
       ImmutableCatalogRegistration.builder()
          .id(String) // optional id
          .datacenter(String) // optional datacenter
          .node(String) // required node
          .address(String) // required address
          .putNodeMeta|putAllNodeMeta(String => String) // nodeMeta mappings
          .taggedAddresses(org.kiwiproject.consul.model.catalog.TaggedAddresses) // optional taggedAddresses
          .service(org.kiwiproject.consul.model.health.Service) // optional service
          .check(org.kiwiproject.consul.model.agent.Check) // optional check
          .writeRequest(org.kiwiproject.consul.model.catalog.WriteRequest) // optional writeRequest
          .skipNodeUpdate(Boolean) // optional skipNodeUpdate
          .build();
       
      Returns:
      A new ImmutableCatalogRegistration builder