- }
-
- /**
- * @return The value of the {@code wait} attribute
- */
- @Override
- public Optional<String> getWait() {
- return wait;
- }
-
- /**
- * @return The value of the {@code token} attribute
- */
- @Override
- public Optional<String> getToken() {
- return token;
- }
-
- /**
- * @return The value of the {@code index} attribute
- */
- @Override
- public Optional<BigInteger> getIndex() {
- return index;
- }
-
- /**
- * @return The value of the {@code near} attribute
- */
- @Override
- public Optional<String> getNear() {
- return near;
- }
-
- /**
- * @return The value of the {@code consistencyMode} attribute
- */
- @Override
- public ConsistencyMode getConsistencyMode() {
- return initShim != null
- ? initShim.getConsistencyMode()
- : consistencyMode;
- }
-
- /**
- * @return The computed-at-construction value of the {@code isBlocking} attribute
- */
- @Override
- public boolean isBlocking() {
- return initShim != null
- ? initShim.isBlocking()
- : isBlocking;
- }
-
- /**
- * @return The computed-at-construction value of the {@code hasToken} attribute
- */
- @Override
- public boolean hasToken() {
- return initShim != null
- ? initShim.hasToken()
- : hasToken;
- }
-
- /**
- * Copy the current immutable object by setting a <i>present</i> value for the optional {@link QueryOptions#getWait() wait} attribute.
- * @param value The value for wait
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withWait(String value) {
- Optional<String> newValue = Optional.of(value);
- return validate(new ImmutableQueryOptions(newValue, this.token, this.index, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getWait() wait} attribute.
- * A shallow reference equality check on the optional value is used to prevent copying of the same value by returning {@code this}.
- * @param optional A value for wait
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withWait(Optional<String> optional) {
- Optional<String> value = Preconditions.checkNotNull(optional, "wait");
- if (this.wait == value) return this;
- return validate(new ImmutableQueryOptions(value, this.token, this.index, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting a <i>present</i> value for the optional {@link QueryOptions#getToken() token} attribute.
- * @param value The value for token
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withToken(String value) {
- Optional<String> newValue = Optional.of(value);
- return validate(new ImmutableQueryOptions(this.wait, newValue, this.index, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getToken() token} attribute.
- * A shallow reference equality check on the optional value is used to prevent copying of the same value by returning {@code this}.
- * @param optional A value for token
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withToken(Optional<String> optional) {
- Optional<String> value = Preconditions.checkNotNull(optional, "token");
- if (this.token == value) return this;
- return validate(new ImmutableQueryOptions(this.wait, value, this.index, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting a <i>present</i> value for the optional {@link QueryOptions#getIndex() index} attribute.
- * @param value The value for index
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withIndex(BigInteger value) {
- Optional<BigInteger> newValue = Optional.of(value);
- return validate(new ImmutableQueryOptions(this.wait, this.token, newValue, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getIndex() index} attribute.
- * A shallow reference equality check on the optional value is used to prevent copying of the same value by returning {@code this}.
- * @param optional A value for index
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withIndex(Optional<BigInteger> optional) {
- Optional<BigInteger> value = Preconditions.checkNotNull(optional, "index");
- if (this.index == value) return this;
- return validate(new ImmutableQueryOptions(this.wait, this.token, value, this.near, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting a <i>present</i> value for the optional {@link QueryOptions#getNear() near} attribute.
- * @param value The value for near
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withNear(String value) {
- Optional<String> newValue = Optional.of(value);
- return validate(new ImmutableQueryOptions(this.wait, this.token, this.index, newValue, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getNear() near} attribute.
- * A shallow reference equality check on the optional value is used to prevent copying of the same value by returning {@code this}.
- * @param optional A value for near
- * @return A modified copy of {@code this} object
- */
- public final ImmutableQueryOptions withNear(Optional<String> optional) {
- Optional<String> value = Preconditions.checkNotNull(optional, "near");
- if (this.near == value) return this;
- return validate(new ImmutableQueryOptions(this.wait, this.token, this.index, value, this.consistencyMode));
- }
-
- /**
- * Copy the current immutable object by setting a value for the {@link QueryOptions#getConsistencyMode() consistencyMode} attribute.
- * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}.
- * @param value A new value for consistencyMode
- * @return A modified copy of the {@code this} object
- */
- public final ImmutableQueryOptions withConsistencyMode(ConsistencyMode value) {
- if (this.consistencyMode == value) return this;
- return validate(new ImmutableQueryOptions(
- this.wait,
- this.token,
- this.index,
- this.near,
- Preconditions.checkNotNull(value, "consistencyMode")));
- }
-
- /**
- * This instance is equal to all instances of {@code ImmutableQueryOptions} that have equal attribute values.
- * @return {@code true} if {@code this} is equal to {@code another} instance
- */
- @Override
- public boolean equals(Object another) {
- if (this == another) return true;
- return another instanceof ImmutableQueryOptions
- && equalTo((ImmutableQueryOptions) another);
- }
-
- private boolean equalTo(ImmutableQueryOptions another) {
- return wait.equals(another.wait)
- && token.equals(another.token)
- && index.equals(another.index)
- && near.equals(another.near)
- && consistencyMode.equals(another.consistencyMode)
- && isBlocking == another.isBlocking
- && hasToken == another.hasToken;
- }
-
- /**
- * Computes a hash code from attributes: {@code wait}, {@code token}, {@code index}, {@code near}, {@code consistencyMode}, {@code isBlocking}, {@code hasToken}.
- * @return hashCode value
- */
- @Override
- public int hashCode() {
- int h = 31;
- h = h * 17 + wait.hashCode();
- h = h * 17 + token.hashCode();
- h = h * 17 + index.hashCode();
- h = h * 17 + near.hashCode();
- h = h * 17 + consistencyMode.hashCode();
- h = h * 17 + Booleans.hashCode(isBlocking);
- h = h * 17 + Booleans.hashCode(hasToken);
- return h;
- }
-
- /**
- * Prints the immutable value {@code QueryOptions...} with all non-generated
- * and non-auxiliary attribute values.
- * @return A string representation of the value
- */
- @Override
- public String toString() {
- return MoreObjects.toStringHelper("QueryOptions")
- .add("wait", wait)
- .add("token", token)
- .add("index", index)
- .add("near", near)
- .add("consistencyMode", consistencyMode)
- .add("isBlocking", isBlocking)
- .add("hasToken", hasToken)
- .toString();
- }
-
- private static ImmutableQueryOptions validate(ImmutableQueryOptions instance) {
- instance.validate();
- return instance;
- }
-
- /**
- * Creates an immutable copy of a {@link QueryOptions} value.
- * Uses accessors to get values to initialize the new immutable instance.
- * If an instance is already immutable, it is returned as is.
- * @param instance The instance to copy
- * @return A copied immutable QueryOptions instance
- */
- public static ImmutableQueryOptions copyOf(QueryOptions instance) {
- if (instance instanceof ImmutableQueryOptions) {
- return (ImmutableQueryOptions) instance;