/** * Creates an immutable copy of a {@link Ports} 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 Ports instance */ public static ImmutablePorts copyOf(Ports instance) { if (instance instanceof ImmutablePorts) { return (ImmutablePorts) instance; } return ImmutablePorts.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 ImmutablePorts fromJson(Json json) { ImmutablePorts.Builder builder = ImmutablePorts.builder(); if (json.dns != null) { builder.dns(json.dns); } if (json.http != null) { builder.http(json.http); } if (json.rpc != null) { builder.rpc(json.rpc); } if (json.serfLan != null) { builder.serfLan(json.serfLan); } if (json.serfWan != null) { builder.serfWan(json.serfWan); } if (json.server != null) { builder.server(json.server); } return builder.build(); }