/** * Copy the current immutable object with elements that replace the content of {@link Session#getChecks() checks}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableSession withChecks(String... elements) { ImmutableList<String> newValue = ImmutableList.copyOf(elements); return new ImmutableSession(this.lockDelay, this.name, this.node, newValue, this.behavior, this.ttl); }
/** * Builds a new {@link ImmutableSession ImmutableSession}. * @return An immutable instance of Session * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableSession build() { return new ImmutableSession(lockDelay, name, node, checksBuilder.build(), behavior, ttl); } }
/** * Copy the current immutable object with elements that replace the content of {@link Session#getChecks() checks}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of checks elements to set * @return A modified copy of {@code this} object */ public final ImmutableSession withChecks(Iterable<String> elements) { if (this.checks == elements) return this; ImmutableList<String> newValue = ImmutableList.copyOf(elements); return new ImmutableSession(this.lockDelay, this.name, this.node, newValue, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Session#getTtl() ttl} attribute. * @param value The value for ttl * @return A modified copy of {@code this} object */ public final ImmutableSession withTtl(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "ttl"); if (Objects.equals(this.ttl, newValue)) return this; return new ImmutableSession(this.lockDelay, this.name, this.node, this.checks, this.behavior, newValue); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Session#getName() name} attribute. * @param value The value for name * @return A modified copy of {@code this} object */ public final ImmutableSession withName(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "name"); if (Objects.equals(this.name, newValue)) return this; return new ImmutableSession(this.lockDelay, newValue, this.node, this.checks, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting an optional value for the {@link Session#getNode() node} 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 node * @return A modified copy of {@code this} object */ public final ImmutableSession withNode(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.node, value)) return this; return new ImmutableSession(this.lockDelay, this.name, value, this.checks, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Session#getLockDelay() lockDelay} attribute. * @param value The value for lockDelay * @return A modified copy of {@code this} object */ public final ImmutableSession withLockDelay(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "lockDelay"); if (Objects.equals(this.lockDelay, newValue)) return this; return new ImmutableSession(newValue, this.name, this.node, this.checks, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Session#getBehavior() behavior} attribute. * @param value The value for behavior * @return A modified copy of {@code this} object */ public final ImmutableSession withBehavior(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "behavior"); if (Objects.equals(this.behavior, newValue)) return this; return new ImmutableSession(this.lockDelay, this.name, this.node, this.checks, newValue, this.ttl); }
/** * Copy the current immutable object by setting an optional value for the {@link Session#getBehavior() behavior} 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 behavior * @return A modified copy of {@code this} object */ public final ImmutableSession withBehavior(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.behavior, value)) return this; return new ImmutableSession(this.lockDelay, this.name, this.node, this.checks, value, this.ttl); }
/** * Copy the current immutable object by setting an optional value for the {@link Session#getTtl() ttl} 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 ttl * @return A modified copy of {@code this} object */ public final ImmutableSession withTtl(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.ttl, value)) return this; return new ImmutableSession(this.lockDelay, this.name, this.node, this.checks, this.behavior, value); }
/** * Copy the current immutable object by setting an optional value for the {@link Session#getLockDelay() lockDelay} 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 lockDelay * @return A modified copy of {@code this} object */ public final ImmutableSession withLockDelay(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.lockDelay, value)) return this; return new ImmutableSession(value, this.name, this.node, this.checks, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting an optional value for the {@link Session#getName() name} 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 name * @return A modified copy of {@code this} object */ public final ImmutableSession withName(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.name, value)) return this; return new ImmutableSession(this.lockDelay, value, this.node, this.checks, this.behavior, this.ttl); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Session#getNode() node} attribute. * @param value The value for node * @return A modified copy of {@code this} object */ public final ImmutableSession withNode(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "node"); if (Objects.equals(this.node, newValue)) return this; return new ImmutableSession(this.lockDelay, this.name, newValue, this.checks, this.behavior, this.ttl); }