/** * Copy the current immutable object by setting a value for the {@link Telemetry#getDisableHostname() disableHostname} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for disableHostname * @return A modified copy of the {@code this} object */ public final ImmutableTelemetry withDisableHostname(Boolean value) { if (this.disableHostname.equals(value)) return this; return new ImmutableTelemetry( this.statsiteAddr, this.statsdAddr, this.statsitePrefix, Preconditions.checkNotNull(value, "disableHostname"), this.dogStatsdAddr, this.dogStatsdTags); }
/** * Copy the current immutable object by setting a value for the {@link Telemetry#getStatsitePrefix() statsitePrefix} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for statsitePrefix * @return A modified copy of the {@code this} object */ public final ImmutableTelemetry withStatsitePrefix(String value) { if (this.statsitePrefix.equals(value)) return this; return new ImmutableTelemetry( this.statsiteAddr, this.statsdAddr, Preconditions.checkNotNull(value, "statsitePrefix"), this.disableHostname, this.dogStatsdAddr, this.dogStatsdTags); }
/** * Copy the current immutable object by setting a value for the {@link Telemetry#getStatsiteAddr() statsiteAddr} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for statsiteAddr * @return A modified copy of the {@code this} object */ public final ImmutableTelemetry withStatsiteAddr(String value) { if (this.statsiteAddr.equals(value)) return this; return new ImmutableTelemetry( Preconditions.checkNotNull(value, "statsiteAddr"), this.statsdAddr, this.statsitePrefix, this.disableHostname, this.dogStatsdAddr, this.dogStatsdTags); }
/** * Copy the current immutable object by setting an optional value for the {@link Telemetry#getDogStatsdTags() dogStatsdTags} 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 dogStatsdTags * @return A modified copy of {@code this} object */ public final ImmutableTelemetry withDogStatsdTags(Optional<List<String>> optional) { @Nullable List<String> value = optional.orElse(null); if (this.dogStatsdTags == value) return this; return new ImmutableTelemetry( this.statsiteAddr, this.statsdAddr, this.statsitePrefix, this.disableHostname, this.dogStatsdAddr, value); }
/** * Copy the current immutable object by setting a value for the {@link Telemetry#getStatsdAddr() statsdAddr} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for statsdAddr * @return A modified copy of the {@code this} object */ public final ImmutableTelemetry withStatsdAddr(String value) { if (this.statsdAddr.equals(value)) return this; return new ImmutableTelemetry( this.statsiteAddr, Preconditions.checkNotNull(value, "statsdAddr"), this.statsitePrefix, this.disableHostname, this.dogStatsdAddr, this.dogStatsdTags); }
/** * Copy the current immutable object by setting a value for the {@link Telemetry#getDogStatsdAddr() dogStatsdAddr} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for dogStatsdAddr * @return A modified copy of the {@code this} object */ public final ImmutableTelemetry withDogStatsdAddr(String value) { if (this.dogStatsdAddr.equals(value)) return this; return new ImmutableTelemetry( this.statsiteAddr, this.statsdAddr, this.statsitePrefix, this.disableHostname, Preconditions.checkNotNull(value, "dogStatsdAddr"), this.dogStatsdTags); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link Telemetry#getDogStatsdTags() dogStatsdTags} attribute. * @param value The value for dogStatsdTags * @return A modified copy of {@code this} object */ public final ImmutableTelemetry withDogStatsdTags(List<String> value) { @Nullable List<String> newValue = Preconditions.checkNotNull(value, "dogStatsdTags"); if (this.dogStatsdTags == newValue) return this; return new ImmutableTelemetry( this.statsiteAddr, this.statsdAddr, this.statsitePrefix, this.disableHostname, this.dogStatsdAddr, newValue); }
/** * Builds a new {@link ImmutableTelemetry ImmutableTelemetry}. * @return An immutable instance of Telemetry * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableTelemetry build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableTelemetry(statsiteAddr, statsdAddr, statsitePrefix, disableHostname, dogStatsdAddr, dogStatsdTags); }