/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Registration.RegCheck#getArgs() args} attribute. * @param value The value for args * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withArgs(List<String> value) { @Nullable List<String> newValue = Preconditions.checkNotNull(value, "args"); if (this.args == newValue) return this; return validate(new ImmutableRegCheck( newValue, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
/** * This instance is equal to all instances of {@code ImmutableRegCheck} 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 ImmutableRegCheck && equalTo((ImmutableRegCheck) another); }
public static RegCheck ttl(long ttl) { return ImmutableRegCheck .builder() .ttl(String.format("%ss", ttl)) .build(); }
private static ImmutableRegCheck validate(ImmutableRegCheck instance) { instance.validate(); return instance; }
/** * Builds a new {@link ImmutableRegCheck ImmutableRegCheck}. * @return An immutable instance of RegCheck * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableRegCheck build() { return ImmutableRegCheck.validate(new ImmutableRegCheck( args, interval, ttl, http, tcp, grpc, grpcUseTls, timeout, notes, deregisterCriticalServiceAfter, tlsSkipVerify, status)); } }
public static RegCheck http(String http, long interval) { return ImmutableRegCheck .builder() .http(http) .interval(String.format("%ss", interval)) .build(); }
public static RegCheck args(List<String> args, long interval) { return ImmutableRegCheck .builder() .args(args) .interval(String.format("%ss", interval)) .build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Registration.RegCheck#getGrpcUseTls() grpcUseTls} attribute. * @param value The value for grpcUseTls * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withGrpcUseTls(boolean value) { @Nullable Boolean newValue = value; if (Objects.equals(this.grpcUseTls, newValue)) return this; return validate(new ImmutableRegCheck( this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, newValue, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
public static RegCheck tcp(String tcp, long interval) { return ImmutableRegCheck .builder() .tcp(tcp) .interval(String.format("%ss", interval)) .build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Registration.RegCheck#getTlsSkipVerify() tlsSkipVerify} attribute. * @param value The value for tlsSkipVerify * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withTlsSkipVerify(boolean value) { @Nullable Boolean newValue = value; if (Objects.equals(this.tlsSkipVerify, newValue)) return this; return validate(new ImmutableRegCheck( this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, newValue, this.status)); }
/** * Creates an immutable copy of a {@link Registration.RegCheck} 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 RegCheck instance */ public static ImmutableRegCheck copyOf(Registration.RegCheck instance) { if (instance instanceof ImmutableRegCheck) { return (ImmutableRegCheck) instance; } return ImmutableRegCheck.builder() .from(instance) .build(); }
/** * Copy the current immutable object by setting an optional value for the {@link Registration.RegCheck#getArgs() args} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for args * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withArgs(Optional<List<String>> optional) { @Nullable List<String> value = optional.orElse(null); if (this.args == value) return this; return validate(new ImmutableRegCheck( value, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
public static RegCheck args(List<String> args, long interval, long timeout) { return ImmutableRegCheck .builder() .args(args) .interval(String.format("%ss", interval)) .timeout(String.format("%ss", timeout)) .build(); }
/** * Copy the current immutable object by setting an optional value for the {@link Registration.RegCheck#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 ImmutableRegCheck withInterval(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.interval, value)) return this; return validate(new ImmutableRegCheck( this.args, value, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
public static RegCheck tcp(String tcp, long interval, long timeout) { return ImmutableRegCheck .builder() .tcp(tcp) .interval(String.format("%ss", interval)) .timeout(String.format("%ss", timeout)) .build(); }
/** * Copy the current immutable object by setting an optional value for the {@link Registration.RegCheck#getGrpc() grpc} 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 grpc * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withGrpc(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.grpc, value)) return this; return validate(new ImmutableRegCheck( this.args, this.interval, this.ttl, this.http, this.tcp, value, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
public static RegCheck http(String http, long interval, long timeout) { return ImmutableRegCheck .builder() .http(http) .interval(String.format("%ss", interval)) .timeout(String.format("%ss", timeout)) .build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Registration.RegCheck#getInterval() interval} attribute. * @param value The value for interval * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withInterval(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "interval"); if (Objects.equals(this.interval, newValue)) return this; return validate(new ImmutableRegCheck( this.args, newValue, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, this.timeout, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }
public static RegCheck args(List<String> args, long interval, long timeout, String notes) { return ImmutableRegCheck .builder() .args(args) .interval(String.format("%ss", interval)) .timeout(String.format("%ss", timeout)) .notes(notes) .build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Registration.RegCheck#getTimeout() timeout} attribute. * @param value The value for timeout * @return A modified copy of {@code this} object */ public final ImmutableRegCheck withTimeout(String value) { @Nullable String newValue = Preconditions.checkNotNull(value, "timeout"); if (Objects.equals(this.timeout, newValue)) return this; return validate(new ImmutableRegCheck( this.args, this.interval, this.ttl, this.http, this.tcp, this.grpc, this.grpcUseTls, newValue, this.notes, this.deregisterCriticalServiceAfter, this.tlsSkipVerify, this.status)); }