private static ImmutableCheck validate(ImmutableCheck instance) { instance.validate(); return instance; }
/** * Copy the current immutable object by setting an optional value for the {@link Check#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 ImmutableCheck withTtl(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.ttl, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, value, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getNotes() notes} attribute. * @param value The value for notes * @return A modified copy of {@code this} object */ public final ImmutableCheck withNotes(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "notes"); if (Objects.equals(this.notes, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, newValue, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getTcp() tcp} 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 tcp * @return A modified copy of {@code this} object */ public final ImmutableCheck withTcp(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.tcp, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, value, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getServiceId() serviceId} 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 serviceId * @return A modified copy of {@code this} object */ public final ImmutableCheck withServiceId(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.serviceId, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, value, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a value for the {@link Check#getName() name} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for name * @return A modified copy of the {@code this} object */ public final ImmutableCheck withName(String value) { if (this.name.equals(value)) return this; return validate(new ImmutableCheck( this.id, Preconditions.checkNotNull(value, "name"), this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getOutput() output} attribute. * @param value The value for output * @return A modified copy of {@code this} object */ public final ImmutableCheck withOutput(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "output"); if (Objects.equals(this.output, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, newValue, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getTtl() ttl} attribute. * @param value The value for ttl * @return A modified copy of {@code this} object */ public final ImmutableCheck withTtl(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "ttl"); if (Objects.equals(this.ttl, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, newValue, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getDeregisterCriticalServiceAfter() deregisterCriticalServiceAfter} attribute. * @param value The value for deregisterCriticalServiceAfter * @return A modified copy of {@code this} object */ public final ImmutableCheck withDeregisterCriticalServiceAfter(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "deregisterCriticalServiceAfter"); if (Objects.equals(this.deregisterCriticalServiceAfter, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, newValue)); }
/** * Copy the current immutable object with elements that replace the content of {@link Check#getServiceTags() serviceTags}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableCheck withServiceTags(String... elements) { ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, newValue, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a value for the {@link Check#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 ImmutableCheck withId(String value) { if (this.id.equals(value)) return this; return validate(new ImmutableCheck( Preconditions.checkNotNull(value, "id"), this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getHttp() http} attribute. * @param value The value for http * @return A modified copy of {@code this} object */ public final ImmutableCheck withHttp(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "http"); if (Objects.equals(this.http, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, newValue, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getOutput() output} 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 output * @return A modified copy of {@code this} object */ public final ImmutableCheck withOutput(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.output, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, value, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getInterval() interval} 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 interval * @return A modified copy of {@code this} object */ public final ImmutableCheck withInterval(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.interval, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, value, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getHttp() http} 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 http * @return A modified copy of {@code this} object */ public final ImmutableCheck withHttp(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.http, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, value, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object with elements that replace the content of {@link Check#getServiceTags() serviceTags}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of serviceTags elements to set * @return A modified copy of {@code this} object */ public final ImmutableCheck withServiceTags(Iterable<String> elements) { if (this.serviceTags == elements) return this; ImmutableList<String> newValue = ImmutableList.copyOf(elements); return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, newValue, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting an optional value for the {@link Check#getDeregisterCriticalServiceAfter() deregisterCriticalServiceAfter} 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 deregisterCriticalServiceAfter * @return A modified copy of {@code this} object */ public final ImmutableCheck withDeregisterCriticalServiceAfter(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.deregisterCriticalServiceAfter, value)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.serviceId, this.serviceTags, value)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getGrpc() grpc} attribute. * @param value The value for grpc * @return A modified copy of {@code this} object */ public final ImmutableCheck withGrpc(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "grpc"); if (Objects.equals(this.grpc, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, newValue, this.grpcUseTls, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getGrpcUseTls() grpcUseTls} attribute. * @param value The value for grpcUseTls * @return A modified copy of {@code this} object */ public final ImmutableCheck withGrpcUseTls(boolean value) { @Nullable Boolean newValue = value; if (Objects.equals(this.grpcUseTls, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, newValue, this.serviceId, this.serviceTags, this.deregisterCriticalServiceAfter)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Check#getServiceId() serviceId} attribute. * @param value The value for serviceId * @return A modified copy of {@code this} object */ public final ImmutableCheck withServiceId(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "serviceId"); if (Objects.equals(this.serviceId, newValue)) return this; return validate(new ImmutableCheck( this.id, this.name, this.notes, this.output, this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, newValue, this.serviceTags, this.deregisterCriticalServiceAfter)); }