Class ImmutableCheck

java.lang.Object
org.kiwiproject.consul.model.agent.Check
org.kiwiproject.consul.model.agent.ImmutableCheck

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

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

  • Method Details

    • getId

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

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

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

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

      public Optional<List<String>> getArgs()
      Specified by:
      getArgs in class Check
      Returns:
      The value of the args attribute
    • getInterval

      public Optional<String> getInterval()
      Specified by:
      getInterval in class Check
      Returns:
      The value of the interval attribute
    • getTtl

      public Optional<String> getTtl()
      Specified by:
      getTtl in class Check
      Returns:
      The value of the ttl attribute
    • getHttp

      public Optional<String> getHttp()
      Specified by:
      getHttp in class Check
      Returns:
      The value of the http attribute
    • getTcp

      public Optional<String> getTcp()
      Specified by:
      getTcp in class Check
      Returns:
      The value of the tcp attribute
    • getGrpc

      public Optional<String> getGrpc()
      Specified by:
      getGrpc in class Check
      Returns:
      The value of the grpc attribute
    • getGrpcUseTls

      public Optional<Boolean> getGrpcUseTls()
      Specified by:
      getGrpcUseTls in class Check
      Returns:
      The value of the grpcUseTls attribute
    • getServiceId

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

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

      public Optional<String> getDeregisterCriticalServiceAfter()
      Specified by:
      getDeregisterCriticalServiceAfter in class Check
      Returns:
      The value of the deregisterCriticalServiceAfter attribute
    • withId

      public final ImmutableCheck 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
    • withName

      public final ImmutableCheck 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
    • withNotes

      public final ImmutableCheck 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 ImmutableCheck 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 ImmutableCheck 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 ImmutableCheck 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
    • withArgs

      public final ImmutableCheck withArgs(List<String> value)
      Copy the current immutable object by setting a present value for the optional args attribute.
      Parameters:
      value - The value for args
      Returns:
      A modified copy of this object
    • withArgs

      public final ImmutableCheck withArgs(Optional<? extends List<String>> optional)
      Copy the current immutable object by setting an optional value for the args 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 args
      Returns:
      A modified copy of this object
    • withInterval

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

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

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

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

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

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

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

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

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

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

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

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

      public final ImmutableCheck 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 ImmutableCheck 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
    • withServiceTags

      public final ImmutableCheck 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 ImmutableCheck 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
    • withDeregisterCriticalServiceAfter

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableCheck 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, name, notes, output, args, interval, ttl, http, tcp, grpc, grpcUseTls, serviceId, serviceTags, deregisterCriticalServiceAfter.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableCheck.Builder builder()
      Creates a builder for ImmutableCheck.
       ImmutableCheck.builder()
          .id(String) // required id
          .name(String) // required name
          .notes(String) // optional notes
          .output(String) // optional output
          .args(List&lt;String&gt;) // optional args
          .interval(String) // optional interval
          .ttl(String) // optional ttl
          .http(String) // optional http
          .tcp(String) // optional tcp
          .grpc(String) // optional grpc
          .grpcUseTls(Boolean) // optional grpcUseTls
          .serviceId(String) // optional serviceId
          .addServiceTags|addAllServiceTags(String) // serviceTags elements
          .deregisterCriticalServiceAfter(String) // optional deregisterCriticalServiceAfter
          .build();
       
      Returns:
      A new ImmutableCheck builder