Class ImmutableHealthCheck

java.lang.Object
org.kiwiproject.consul.model.health.HealthCheck
org.kiwiproject.consul.model.health.ImmutableHealthCheck

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

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

  • Method Details

    • getNode

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

      public String getCheckId()
      Specified by:
      getCheckId in class HealthCheck
      Returns:
      The value of the checkId attribute
    • getName

      public String getName()
      Specified by:
      getName in class HealthCheck
      Returns:
      The value of the name attribute
    • getStatus

      public String getStatus()
      Specified by:
      getStatus in class HealthCheck
      Returns:
      The value of the status attribute
    • getNotes

      public Optional<String> getNotes()
      Specified by:
      getNotes in class HealthCheck
      Returns:
      The value of the notes attribute
    • getOutput

      public Optional<String> getOutput()
      Specified by:
      getOutput in class HealthCheck
      Returns:
      The value of the output attribute
    • getServiceId

      public Optional<String> getServiceId()
      Specified by:
      getServiceId in class HealthCheck
      Returns:
      The value of the serviceId attribute
    • getServiceName

      public Optional<String> getServiceName()
      Specified by:
      getServiceName in class HealthCheck
      Returns:
      The value of the serviceName attribute
    • getServiceTags

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

      public final ImmutableHealthCheck 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
    • withCheckId

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

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

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

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

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

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

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

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

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

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

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

      public final ImmutableHealthCheck 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 ImmutableHealthCheck 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableHealthCheck 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, checkId, name, status, notes, output, serviceId, serviceName, serviceTags.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableHealthCheck.Builder builder()
      Creates a builder for ImmutableHealthCheck.
       ImmutableHealthCheck.builder()
          .node(String) // required node
          .checkId(String) // required checkId
          .name(String) // required name
          .status(String) // required status
          .notes(String) // optional notes
          .output(String) // optional output
          .serviceId(String) // optional serviceId
          .serviceName(String) // optional serviceName
          .addServiceTags|addAllServiceTags(String) // serviceTags elements
          .build();
       
      Returns:
      A new ImmutableHealthCheck builder