/** * Builds a new {@link ImmutablePutOptions ImmutablePutOptions}. * @return An immutable instance of PutOptions * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutablePutOptions build() { return new ImmutablePutOptions(cas, acquire, release, dc, token); } }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PutOptions#getCas() cas} attribute. * @param value The value for cas * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withCas(long value) { @Nullable Long newValue = value; if (Objects.equals(this.cas, newValue)) return this; return new ImmutablePutOptions(newValue, this.acquire, this.release, this.dc, this.token); }
/** * Copy the current immutable object by setting an optional value for the {@link PutOptions#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 ImmutablePutOptions withToken(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.token, value)) return this; return new ImmutablePutOptions(this.cas, this.acquire, this.release, this.dc, value); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PutOptions#getRelease() release} attribute. * @param value The value for release * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withRelease(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "release"); if (Objects.equals(this.release, newValue)) return this; return new ImmutablePutOptions(this.cas, this.acquire, newValue, this.dc, this.token); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PutOptions#getAcquire() acquire} attribute. * @param value The value for acquire * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withAcquire(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "acquire"); if (Objects.equals(this.acquire, newValue)) return this; return new ImmutablePutOptions(this.cas, newValue, this.release, this.dc, this.token); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PutOptions#getDc() dc} attribute. * @param value The value for dc * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withDc(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "dc"); if (Objects.equals(this.dc, newValue)) return this; return new ImmutablePutOptions(this.cas, this.acquire, this.release, newValue, this.token); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PutOptions#getToken() token} attribute. * @param value The value for token * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withToken(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "token"); if (Objects.equals(this.token, newValue)) return this; return new ImmutablePutOptions(this.cas, this.acquire, this.release, this.dc, newValue); }
/** * Copy the current immutable object by setting an optional value for the {@link PutOptions#getCas() cas} 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 cas * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withCas(Optional<Long> optional) { @Nullable Long value = optional.orElse(null); if (Objects.equals(this.cas, value)) return this; return new ImmutablePutOptions(value, this.acquire, this.release, this.dc, this.token); }
/** * Copy the current immutable object by setting an optional value for the {@link PutOptions#getAcquire() acquire} 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 acquire * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withAcquire(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.acquire, value)) return this; return new ImmutablePutOptions(this.cas, value, this.release, this.dc, this.token); }
/** * Copy the current immutable object by setting an optional value for the {@link PutOptions#getRelease() release} 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 release * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withRelease(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.release, value)) return this; return new ImmutablePutOptions(this.cas, this.acquire, value, this.dc, this.token); }
/** * Copy the current immutable object by setting an optional value for the {@link PutOptions#getDc() dc} 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 dc * @return A modified copy of {@code this} object */ public final ImmutablePutOptions withDc(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.dc, value)) return this; return new ImmutablePutOptions(this.cas, this.acquire, this.release, value, this.token); }