private static ImmutableQueryOptions validate(ImmutableQueryOptions instance) { instance.validate(); return instance; }
/** * Copy the current immutable object with elements that replace the content of {@link QueryOptions#getTag() tag}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withTag(String... elements) { ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, this.datacenter, this.nodeMeta, newValue, this.consistencyMode)); }
/** * Copy the current immutable object with elements that replace the content of {@link QueryOptions#getNodeMeta() nodeMeta}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withNodeMeta(String... elements) { ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, this.datacenter, newValue, this.tag, this.consistencyMode)); }
/** * 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) { @Nullable String newValue = Preconditions.checkNotNull(value, "wait"); if (Objects.equals(this.wait, newValue)) return this; return validate(new ImmutableQueryOptions( newValue, this.token, this.index, this.near, this.datacenter, this.nodeMeta, this.tag, 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, this.datacenter, this.nodeMeta, this.tag, Preconditions.checkNotNull(value, "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) { @Nullable BigInteger newValue = Preconditions.checkNotNull(value, "index"); if (this.index == newValue) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, newValue, this.near, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link QueryOptions#getDatacenter() datacenter} attribute. * @param value The value for datacenter * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withDatacenter(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "datacenter"); if (Objects.equals(this.datacenter, newValue)) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, newValue, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getDatacenter() datacenter} attribute. * An equality check is used on inner nullable value to prevent copying of the same value by returning {@code this}. * @param optional A value for datacenter * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withDatacenter(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.datacenter, value)) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, value, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getWait() wait} attribute. * An equality check is used on inner nullable value 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) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.wait, value)) return this; return validate(new ImmutableQueryOptions( value, this.token, this.index, this.near, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object with elements that replace the content of {@link QueryOptions#getNodeMeta() nodeMeta}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of nodeMeta elements to set * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withNodeMeta(Iterable<String> elements) { if (this.nodeMeta == elements) return this; ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, this.datacenter, newValue, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object with elements that replace the content of {@link QueryOptions#getTag() tag}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of tag elements to set * @return A modified copy of {@code this} object */ public final ImmutableQueryOptions withTag(Iterable<String> elements) { if (this.tag == elements) return this; ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, this.near, this.datacenter, this.nodeMeta, newValue, 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) { @Nullable String newValue = Preconditions.checkNotNull(value, "token"); if (Objects.equals(this.token, newValue)) return this; return validate(new ImmutableQueryOptions( this.wait, newValue, this.index, this.near, this.datacenter, this.nodeMeta, this.tag, 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) { @Nullable String newValue = Preconditions.checkNotNull(value, "near"); if (Objects.equals(this.near, newValue)) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, newValue, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getToken() token} attribute. * An equality check is used on inner nullable value 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) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.token, value)) return this; return validate(new ImmutableQueryOptions( this.wait, value, this.index, this.near, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getIndex() index} attribute. * A shallow reference equality check is used on unboxed optional value 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) { @Nullable BigInteger value = optional.orElse(null); if (this.index == value) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, value, this.near, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }
/** * Copy the current immutable object by setting an optional value for the {@link QueryOptions#getNear() near} attribute. * An equality check is used on inner nullable value 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) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.near, value)) return this; return validate(new ImmutableQueryOptions( this.wait, this.token, this.index, value, this.datacenter, this.nodeMeta, this.tag, this.consistencyMode)); }