Class ImmutableQueryOptions

  • All Implemented Interfaces:
    ParamAdder

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

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

    • Method Detail

      • getWait

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

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

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

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

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

        public java.util.Optional<java.lang.String> getDatacenter()
        Specified by:
        getDatacenter in class QueryOptions
        Returns:
        The value of the datacenter attribute
      • getNodeMeta

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

        public com.google.common.collect.ImmutableList<java.lang.String> getTag()
        Specified by:
        getTag in class QueryOptions
        Returns:
        The value of the tag 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 java.util.List<java.lang.String> getNodeMetaQuery()
        Overrides:
        getNodeMetaQuery in class QueryOptions
        Returns:
        The computed-at-construction value of the nodeMetaQuery attribute
      • getTagsQuery

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

        public final ImmutableQueryOptions withWait​(java.lang.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​(java.util.Optional<java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.math.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​(java.util.Optional<? extends java.math.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​(java.lang.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​(java.util.Optional<java.lang.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​(java.lang.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​(java.util.Optional<java.lang.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
      • withNodeMeta

        public final ImmutableQueryOptions withNodeMeta​(java.lang.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​(java.lang.Iterable<java.lang.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​(java.lang.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​(java.lang.Iterable<java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableQueryOptions that have equal attribute values.
        Overrides:
        equals in class java.lang.Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: wait, token, hash, index, near, datacenter, nodeMeta, tag, consistencyMode, isBlocking, hasToken, nodeMetaQuery, tagsQuery.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value QueryOptions with attribute values.
        Overrides:
        toString in class java.lang.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()
            .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
            .addNodeMeta|addAllNodeMeta(String) // nodeMeta elements
            .addTag|addAllTag(String) // tag elements
            .consistencyMode(com.orbitz.consul.option.ConsistencyMode) // optional consistencyMode
            .build();
         
        Returns:
        A new ImmutableQueryOptions builder