/** * @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 ImmutableConfig fromJson(Json json) { ImmutableConfig.Builder builder = ImmutableConfig.builder(); if (json.datacenter != null) { builder.datacenter(json.datacenter); } if (json.nodeName != null) { builder.nodeName(json.nodeName); } if (json.revision != null) { builder.revision(json.revision); } if (json.server != null) { builder.server(json.server); } if (json.version != null) { builder.version(json.version); } return builder.build(); }
/** * Fill a builder with attribute values from the provided {@code Config} 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(Config instance) { Preconditions.checkNotNull(instance, "instance"); datacenter(instance.getDatacenter()); nodeName(instance.getNodeName()); revision(instance.getRevision()); server(instance.getServer()); version(instance.getVersion()); return this; }