Class ImmutableQueryOptions

java.lang.Object
org.kiwiproject.consul.option.QueryOptions
org.kiwiproject.consul.option.ImmutableQueryOptions
All Implemented Interfaces:
ParamAdder

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

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

  • Method Details

    • toQueryParameters

      public com.google.common.collect.ImmutableList<String> toQueryParameters()
      Returns:
      The value of the toQueryParameters attribute
    • getWait

      public Optional<String> getWait()
      Specified by:
      getWait in class QueryOptions
      Returns:
      The value of the wait attribute
    • getToken

      public Optional<String> getToken()
      Specified by:
      getToken in class QueryOptions
      Returns:
      The value of the token attribute
    • getHash

      public Optional<String> getHash()
      Specified by:
      getHash in class QueryOptions
      Returns:
      The value of the hash attribute
    • getIndex

      public Optional<BigInteger> getIndex()
      Specified by:
      getIndex in class QueryOptions
      Returns:
      The value of the index attribute
    • getNear

      public Optional<String> getNear()
      Specified by:
      getNear in class QueryOptions
      Returns:
      The value of the near attribute
    • getDatacenter

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

      public Optional<String> getFilter()
      Specified by:
      getFilter in class QueryOptions
      Returns:
      The value of the filter attribute
    • getNamespace

      public Optional<String> getNamespace()
      Specified by:
      getNamespace in class QueryOptions
      Returns:
      The value of the namespace attribute
    • getWan

      public Optional<Boolean> getWan()
      Specified by:
      getWan in class QueryOptions
      Returns:
      The value of the wan attribute
    • getSegment

      public Optional<String> getSegment()
      Specified by:
      getSegment in class QueryOptions
      Returns:
      The value of the segment attribute
    • getNote

      public Optional<String> getNote()
      Specified by:
      getNote in class QueryOptions
      Returns:
      The value of the note attribute
    • getEnable

      public Optional<Boolean> getEnable()
      Specified by:
      getEnable in class QueryOptions
      Returns:
      The value of the enable attribute
    • getReason

      public Optional<String> getReason()
      Specified by:
      getReason in class QueryOptions
      Returns:
      The value of the reason attribute
    • getNodeMeta

      public com.google.common.collect.ImmutableList<String> getNodeMeta()
      Specified by:
      getNodeMeta in class QueryOptions
      Returns:
      The value of the nodeMeta attribute
    • getTag

      public com.google.common.collect.ImmutableList<String> getTag()
      Specified by:
      getTag in class QueryOptions
      Returns:
      The value of the tag attribute
    • getConsistencyMode

      public ConsistencyMode getConsistencyMode()
      Overrides:
      getConsistencyMode in class QueryOptions
      Returns:
      The value of the consistencyMode attribute
    • isBlocking

      public boolean isBlocking()
      Overrides:
      isBlocking in class QueryOptions
      Returns:
      The computed-at-construction value of the isBlocking attribute
    • hasToken

      public boolean hasToken()
      Overrides:
      hasToken in class QueryOptions
      Returns:
      The computed-at-construction value of the hasToken attribute
    • getNodeMetaQuery

      public List<String> getNodeMetaQuery()
      Overrides:
      getNodeMetaQuery in class QueryOptions
      Returns:
      The computed-at-construction value of the nodeMetaQuery attribute
    • getTagsQuery

      public List<String> getTagsQuery()
      Overrides:
      getTagsQuery in class QueryOptions
      Returns:
      The computed-at-construction value of the tagsQuery attribute
    • withToQueryParameters

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

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

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

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

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

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

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

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

      public final ImmutableQueryOptions withIndex(BigInteger value)
      Copy the current immutable object by setting a present value for the optional index attribute.
      Parameters:
      value - The value for index
      Returns:
      A modified copy of this object
    • withIndex

      public final ImmutableQueryOptions withIndex(Optional<? extends BigInteger> optional)
      Copy the current immutable object by setting an optional value for the index 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 index
      Returns:
      A modified copy of this object
    • withNear

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

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

      public final ImmutableQueryOptions 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 ImmutableQueryOptions 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
    • withFilter

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public final ImmutableQueryOptions withConsistencyMode(ConsistencyMode value)
      Copy the current immutable object by setting a value for the consistencyMode attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for consistencyMode
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableQueryOptions 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: toQueryParameters, wait, token, hash, index, near, datacenter, filter, namespace, wan, segment, note, enable, reason, nodeMeta, tag, consistencyMode, isBlocking, hasToken, nodeMetaQuery, tagsQuery.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableQueryOptions.Builder builder()
      Creates a builder for ImmutableQueryOptions.
       ImmutableQueryOptions.builder()
          .addToQueryParameters|addAllToQueryParameters(String) // toQueryParameters elements
          .wait(String) // optional wait
          .token(String) // optional token
          .hash(String) // optional hash
          .index(java.math.BigInteger) // optional index
          .near(String) // optional near
          .datacenter(String) // optional datacenter
          .filter(String) // optional filter
          .namespace(String) // optional namespace
          .wan(Boolean) // optional wan
          .segment(String) // optional segment
          .note(String) // optional note
          .enable(Boolean) // optional enable
          .reason(String) // optional reason
          .addNodeMeta|addAllNodeMeta(String) // nodeMeta elements
          .addTag|addAllTag(String) // tag elements
          .consistencyMode(org.kiwiproject.consul.option.ConsistencyMode) // optional consistencyMode
          .build();
       
      Returns:
      A new ImmutableQueryOptions builder