Class ImmutableFullService

java.lang.Object
org.kiwiproject.consul.model.agent.FullService
org.kiwiproject.consul.model.agent.ImmutableFullService

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableFullService extends FullService
Immutable implementation of FullService.

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

  • Method Details

    • getKind

      public Optional<String> getKind()
      Specified by:
      getKind in class FullService
      Returns:
      The value of the kind attribute
    • getId

      public String getId()
      Specified by:
      getId in class FullService
      Returns:
      The value of the id attribute
    • getService

      public String getService()
      Specified by:
      getService in class FullService
      Returns:
      The value of the service attribute
    • getTags

      public com.google.common.collect.ImmutableList<String> getTags()
      Specified by:
      getTags in class FullService
      Returns:
      The value of the tags attribute
    • getMeta

      public com.google.common.collect.ImmutableMap<String,String> getMeta()
      Specified by:
      getMeta in class FullService
      Returns:
      The value of the meta attribute
    • getPort

      public int getPort()
      Specified by:
      getPort in class FullService
      Returns:
      The value of the port attribute
    • getAddress

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

      public Optional<ServiceWeights> getWeights()
      Specified by:
      getWeights in class FullService
      Returns:
      The value of the weights attribute
    • getEnableTagOverride

      public Optional<Boolean> getEnableTagOverride()
      Specified by:
      getEnableTagOverride in class FullService
      Returns:
      The value of the enableTagOverride attribute
    • getContentHash

      public String getContentHash()
      Specified by:
      getContentHash in class FullService
      Returns:
      The value of the contentHash attribute
    • getProxy

      public Optional<ServiceProxy> getProxy()
      Specified by:
      getProxy in class FullService
      Returns:
      The value of the proxy attribute
    • withKind

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

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

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

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

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

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

      public final ImmutableFullService withMeta(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the meta 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 meta map
      Returns:
      A modified copy of this object
    • withPort

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

      public final ImmutableFullService 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
    • withWeights

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

      public final ImmutableFullService withWeights(Optional<? extends ServiceWeights> optional)
      Copy the current immutable object by setting an optional value for the weights 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 weights
      Returns:
      A modified copy of this object
    • withEnableTagOverride

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

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

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

      public final ImmutableFullService withProxy(ServiceProxy value)
      Copy the current immutable object by setting a present value for the optional proxy attribute.
      Parameters:
      value - The value for proxy
      Returns:
      A modified copy of this object
    • withProxy

      public final ImmutableFullService withProxy(Optional<? extends ServiceProxy> optional)
      Copy the current immutable object by setting an optional value for the proxy 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 proxy
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableFullService 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: kind, id, service, tags, meta, port, address, weights, enableTagOverride, contentHash, proxy.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableFullService.Builder builder()
      Creates a builder for ImmutableFullService.
       ImmutableFullService.builder()
          .kind(String) // optional kind
          .id(String) // required id
          .service(String) // required service
          .addTags|addAllTags(String) // tags elements
          .putMeta|putAllMeta(String => String) // meta mappings
          .port(int) // required port
          .address(String) // required address
          .weights(org.kiwiproject.consul.model.catalog.ServiceWeights) // optional weights
          .enableTagOverride(Boolean) // optional enableTagOverride
          .contentHash(String) // required contentHash
          .proxy(org.kiwiproject.consul.model.agent.ServiceProxy) // optional proxy
          .build();
       
      Returns:
      A new ImmutableFullService builder