/** * 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(); }