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