/** * @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(); }
/** * Fill a builder with attribute values from the provided {@code Telemetry} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(Telemetry instance) { Preconditions.checkNotNull(instance, "instance"); statsiteAddr(instance.getStatsiteAddr()); statsdAddr(instance.getStatsdAddr()); statsitePrefix(instance.getStatsitePrefix()); disableHostname(instance.getDisableHostname()); dogStatsdAddr(instance.getDogStatsdAddr()); Optional<List<String>> dogStatsdTagsOptional = instance.getDogStatsdTags(); if (dogStatsdTagsOptional.isPresent()) { dogStatsdTags(dogStatsdTagsOptional); } return this; }