/** * Builds a new {@link ImmutableDeleteOptions ImmutableDeleteOptions}. * @return An immutable instance of DeleteOptions * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableDeleteOptions build() { return new ImmutableDeleteOptions(cas, recurse, datacenter); } }
/** * This instance is equal to all instances of {@code ImmutableDeleteOptions} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@Nullable Object another) { if (this == another) return true; return another instanceof ImmutableDeleteOptions && equalTo((ImmutableDeleteOptions) another); }
/** * Creates an immutable copy of a {@link DeleteOptions} 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 DeleteOptions instance */ public static ImmutableDeleteOptions copyOf(DeleteOptions instance) { if (instance instanceof ImmutableDeleteOptions) { return (ImmutableDeleteOptions) instance; } return ImmutableDeleteOptions.builder() .from(instance) .build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link DeleteOptions#getRecurse() recurse} attribute. * @param value The value for recurse * @return A modified copy of {@code this} object */ public final ImmutableDeleteOptions withRecurse(boolean value) { @Nullable Boolean newValue = value; if (Objects.equals(this.recurse, newValue)) return this; return new ImmutableDeleteOptions(this.cas, newValue, this.datacenter); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link DeleteOptions#getCas() cas} attribute. * @param value The value for cas * @return A modified copy of {@code this} object */ public final ImmutableDeleteOptions withCas(long value) { @Nullable Long newValue = value; if (Objects.equals(this.cas, newValue)) return this; return new ImmutableDeleteOptions(newValue, this.recurse, this.datacenter); }
/** * Copy the current immutable object by setting an optional value for the {@link DeleteOptions#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 ImmutableDeleteOptions withDatacenter(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.datacenter, value)) return this; return new ImmutableDeleteOptions(this.cas, this.recurse, value); }
/** * Copy the current immutable object by setting an optional value for the {@link DeleteOptions#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 ImmutableDeleteOptions withCas(Optional<Long> optional) { @Nullable Long value = optional.orElse(null); if (Objects.equals(this.cas, value)) return this; return new ImmutableDeleteOptions(value, this.recurse, this.datacenter); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link DeleteOptions#getDatacenter() datacenter} attribute. * @param value The value for datacenter * @return A modified copy of {@code this} object */ public final ImmutableDeleteOptions withDatacenter(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "datacenter"); if (Objects.equals(this.datacenter, newValue)) return this; return new ImmutableDeleteOptions(this.cas, this.recurse, newValue); }
/** * Copy the current immutable object by setting an optional value for the {@link DeleteOptions#getRecurse() recurse} 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 recurse * @return A modified copy of {@code this} object */ public final ImmutableDeleteOptions withRecurse(Optional<Boolean> optional) { @Nullable Boolean value = optional.orElse(null); if (Objects.equals(this.recurse, value)) return this; return new ImmutableDeleteOptions(this.cas, value, this.datacenter); }