/** * 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); }
/** * This instance is equal to all instances of {@code ImmutableTelemetry} 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 ImmutableTelemetry && equalTo((ImmutableTelemetry) another); }
/** * Creates an immutable copy of a {@link Telemetry} 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 Telemetry instance */ public static ImmutableTelemetry copyOf(Telemetry instance) { if (instance instanceof ImmutableTelemetry) { return (ImmutableTelemetry) instance; } return ImmutableTelemetry.builder() .from(instance) .build(); }
/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator static ImmutableTelemetry fromJson(Json json) { ImmutableTelemetry.Builder builder = ImmutableTelemetry.builder(); if (json.statsiteAddr != null) { builder.statsiteAddr(json.statsiteAddr); } if (json.statsdAddr != null) { builder.statsdAddr(json.statsdAddr); } if (json.statsitePrefix != null) { builder.statsitePrefix(json.statsitePrefix); } if (json.disableHostname != null) { builder.disableHostname(json.disableHostname); } if (json.dogStatsdAddr != null) { builder.dogStatsdAddr(json.dogStatsdAddr); } if (json.dogStatsdTags != null) { builder.dogStatsdTags(json.dogStatsdTags); } return builder.build(); }
/** * 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 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 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); }