Package com.orbitz.consul.option
Class ImmutableQueryOptions
- java.lang.Object
-
- com.orbitz.consul.option.QueryOptions
-
- com.orbitz.consul.option.ImmutableQueryOptions
-
- All Implemented Interfaces:
ParamAdder
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableQueryOptions extends QueryOptionsImmutable implementation ofQueryOptions.Use the builder to create immutable instances:
ImmutableQueryOptions.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableQueryOptions.BuilderBuilds instances of typeImmutableQueryOptions.
-
Field Summary
-
Fields inherited from class com.orbitz.consul.option.QueryOptions
BLANK
-
-
Method Summary
Modifier and Type Method Description static ImmutableQueryOptions.Builderbuilder()Creates a builder forImmutableQueryOptions.static ImmutableQueryOptionscopyOf(QueryOptions instance)Creates an immutable copy of aQueryOptionsvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableQueryOptionsthat have equal attribute values.ConsistencyModegetConsistencyMode()java.util.Optional<java.lang.String>getDatacenter()java.util.Optional<java.lang.String>getHash()java.util.Optional<java.math.BigInteger>getIndex()java.util.Optional<java.lang.String>getNear()com.google.common.collect.ImmutableList<java.lang.String>getNodeMeta()java.util.List<java.lang.String>getNodeMetaQuery()com.google.common.collect.ImmutableList<java.lang.String>getTag()java.util.List<java.lang.String>getTagsQuery()java.util.Optional<java.lang.String>getToken()java.util.Optional<java.lang.String>getWait()inthashCode()Computes a hash code from attributes:wait,token,hash,index,near,datacenter,nodeMeta,tag,consistencyMode,isBlocking,hasToken,nodeMetaQuery,tagsQuery.booleanhasToken()booleanisBlocking()java.lang.StringtoString()Prints the immutable valueQueryOptionswith attribute values.ImmutableQueryOptionswithConsistencyMode(ConsistencyMode value)Copy the current immutable object by setting a value for theconsistencyModeattribute.ImmutableQueryOptionswithDatacenter(java.lang.String value)Copy the current immutable object by setting a present value for the optionaldatacenterattribute.ImmutableQueryOptionswithDatacenter(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thedatacenterattribute.ImmutableQueryOptionswithHash(java.lang.String value)Copy the current immutable object by setting a present value for the optionalhashattribute.ImmutableQueryOptionswithHash(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thehashattribute.ImmutableQueryOptionswithIndex(java.math.BigInteger value)Copy the current immutable object by setting a present value for the optionalindexattribute.ImmutableQueryOptionswithIndex(java.util.Optional<? extends java.math.BigInteger> optional)Copy the current immutable object by setting an optional value for theindexattribute.ImmutableQueryOptionswithNear(java.lang.String value)Copy the current immutable object by setting a present value for the optionalnearattribute.ImmutableQueryOptionswithNear(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thenearattribute.ImmutableQueryOptionswithNodeMeta(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofnodeMeta.ImmutableQueryOptionswithNodeMeta(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofnodeMeta.ImmutableQueryOptionswithTag(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content oftag.ImmutableQueryOptionswithTag(java.lang.String... elements)Copy the current immutable object with elements that replace the content oftag.ImmutableQueryOptionswithToken(java.lang.String value)Copy the current immutable object by setting a present value for the optionaltokenattribute.ImmutableQueryOptionswithToken(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thetokenattribute.ImmutableQueryOptionswithWait(java.lang.String value)Copy the current immutable object by setting a present value for the optionalwaitattribute.ImmutableQueryOptionswithWait(java.util.Optional<java.lang.String> optional)Copy the current immutable object by setting an optional value for thewaitattribute.-
Methods inherited from class com.orbitz.consul.option.QueryOptions
blockMinutes, blockMinutes, blockSeconds, blockSeconds, toHeaders, toQuery
-
-
-
-
Method Detail
-
getWait
public java.util.Optional<java.lang.String> getWait()
- Specified by:
getWaitin classQueryOptions- Returns:
- The value of the
waitattribute
-
getToken
public java.util.Optional<java.lang.String> getToken()
- Specified by:
getTokenin classQueryOptions- Returns:
- The value of the
tokenattribute
-
getHash
public java.util.Optional<java.lang.String> getHash()
- Specified by:
getHashin classQueryOptions- Returns:
- The value of the
hashattribute
-
getIndex
public java.util.Optional<java.math.BigInteger> getIndex()
- Specified by:
getIndexin classQueryOptions- Returns:
- The value of the
indexattribute
-
getNear
public java.util.Optional<java.lang.String> getNear()
- Specified by:
getNearin classQueryOptions- Returns:
- The value of the
nearattribute
-
getDatacenter
public java.util.Optional<java.lang.String> getDatacenter()
- Specified by:
getDatacenterin classQueryOptions- Returns:
- The value of the
datacenterattribute
-
getNodeMeta
public com.google.common.collect.ImmutableList<java.lang.String> getNodeMeta()
- Specified by:
getNodeMetain classQueryOptions- Returns:
- The value of the
nodeMetaattribute
-
getTag
public com.google.common.collect.ImmutableList<java.lang.String> getTag()
- Specified by:
getTagin classQueryOptions- Returns:
- The value of the
tagattribute
-
getConsistencyMode
public ConsistencyMode getConsistencyMode()
- Overrides:
getConsistencyModein classQueryOptions- Returns:
- The value of the
consistencyModeattribute
-
isBlocking
public boolean isBlocking()
- Overrides:
isBlockingin classQueryOptions- Returns:
- The computed-at-construction value of the
isBlockingattribute
-
hasToken
public boolean hasToken()
- Overrides:
hasTokenin classQueryOptions- Returns:
- The computed-at-construction value of the
hasTokenattribute
-
getNodeMetaQuery
public java.util.List<java.lang.String> getNodeMetaQuery()
- Overrides:
getNodeMetaQueryin classQueryOptions- Returns:
- The computed-at-construction value of the
nodeMetaQueryattribute
-
getTagsQuery
public java.util.List<java.lang.String> getTagsQuery()
- Overrides:
getTagsQueryin classQueryOptions- Returns:
- The computed-at-construction value of the
tagsQueryattribute
-
withWait
public final ImmutableQueryOptions withWait(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalwaitattribute.- Parameters:
value- The value for wait- Returns:
- A modified copy of
thisobject
-
withWait
public final ImmutableQueryOptions withWait(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thewaitattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for wait- Returns:
- A modified copy of
thisobject
-
withToken
public final ImmutableQueryOptions withToken(java.lang.String value)
Copy the current immutable object by setting a present value for the optionaltokenattribute.- Parameters:
value- The value for token- Returns:
- A modified copy of
thisobject
-
withToken
public final ImmutableQueryOptions withToken(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thetokenattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for token- Returns:
- A modified copy of
thisobject
-
withHash
public final ImmutableQueryOptions withHash(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalhashattribute.- Parameters:
value- The value for hash- Returns:
- A modified copy of
thisobject
-
withHash
public final ImmutableQueryOptions withHash(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thehashattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for hash- Returns:
- A modified copy of
thisobject
-
withIndex
public final ImmutableQueryOptions withIndex(java.math.BigInteger value)
Copy the current immutable object by setting a present value for the optionalindexattribute.- Parameters:
value- The value for index- Returns:
- A modified copy of
thisobject
-
withIndex
public final ImmutableQueryOptions withIndex(java.util.Optional<? extends java.math.BigInteger> optional)
Copy the current immutable object by setting an optional value for theindexattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for index- Returns:
- A modified copy of
thisobject
-
withNear
public final ImmutableQueryOptions withNear(java.lang.String value)
Copy the current immutable object by setting a present value for the optionalnearattribute.- Parameters:
value- The value for near- Returns:
- A modified copy of
thisobject
-
withNear
public final ImmutableQueryOptions withNear(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thenearattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for near- Returns:
- A modified copy of
thisobject
-
withDatacenter
public final ImmutableQueryOptions withDatacenter(java.lang.String value)
Copy the current immutable object by setting a present value for the optionaldatacenterattribute.- Parameters:
value- The value for datacenter- Returns:
- A modified copy of
thisobject
-
withDatacenter
public final ImmutableQueryOptions withDatacenter(java.util.Optional<java.lang.String> optional)
Copy the current immutable object by setting an optional value for thedatacenterattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for datacenter- Returns:
- A modified copy of
thisobject
-
withNodeMeta
public final ImmutableQueryOptions withNodeMeta(java.lang.String... elements)
Copy the current immutable object with elements that replace the content ofnodeMeta.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNodeMeta
public final ImmutableQueryOptions withNodeMeta(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content ofnodeMeta. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of nodeMeta elements to set- Returns:
- A modified copy of
thisobject
-
withTag
public final ImmutableQueryOptions withTag(java.lang.String... elements)
Copy the current immutable object with elements that replace the content oftag.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTag
public final ImmutableQueryOptions withTag(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content oftag. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tag elements to set- Returns:
- A modified copy of
thisobject
-
withConsistencyMode
public final ImmutableQueryOptions withConsistencyMode(ConsistencyMode value)
Copy the current immutable object by setting a value for theconsistencyModeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for consistencyMode- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableQueryOptionsthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()
Computes a hash code from attributes:wait,token,hash,index,near,datacenter,nodeMeta,tag,consistencyMode,isBlocking,hasToken,nodeMetaQuery,tagsQuery.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueQueryOptionswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableQueryOptions copyOf(QueryOptions instance)
Creates an immutable copy of aQueryOptionsvalue. 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 forImmutableQueryOptions.ImmutableQueryOptions.builder() .wait(String) // optionalwait.token(String) // optionaltoken.hash(String) // optionalhash.index(java.math.BigInteger) // optionalindex.near(String) // optionalnear.datacenter(String) // optionaldatacenter.addNodeMeta|addAllNodeMeta(String) //nodeMetaelements .addTag|addAllTag(String) //tagelements .consistencyMode(com.orbitz.consul.option.ConsistencyMode) // optionalconsistencyMode.build();- Returns:
- A new ImmutableQueryOptions builder
-
-