/** * Copy the current immutable object by setting a value for the {@link Ports#getDns() dns} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for dns * @return A modified copy of the {@code this} object */ public final ImmutablePorts withDns(int value) { if (this.dns == value) return this; return new ImmutablePorts(value, this.http, this.rpc, this.serfLan, this.serfWan, this.server); }
/** * 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(); }
/** * This instance is equal to all instances of {@code ImmutablePorts} 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 ImmutablePorts && equalTo((ImmutablePorts) another); }
/** * @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(); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getServer() server} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for server * @return A modified copy of the {@code this} object */ public final ImmutablePorts withServer(int value) { if (this.server == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, this.serfLan, this.serfWan, value); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getSerfLan() serfLan} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for serfLan * @return A modified copy of the {@code this} object */ public final ImmutablePorts withSerfLan(int value) { if (this.serfLan == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, value, this.serfWan, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getHttp() http} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for http * @return A modified copy of the {@code this} object */ public final ImmutablePorts withHttp(int value) { if (this.http == value) return this; return new ImmutablePorts(this.dns, value, this.rpc, this.serfLan, this.serfWan, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getRpc() rpc} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for rpc * @return A modified copy of the {@code this} object */ public final ImmutablePorts withRpc(int value) { if (this.rpc == value) return this; return new ImmutablePorts(this.dns, this.http, value, this.serfLan, this.serfWan, this.server); }
/** * Copy the current immutable object by setting a value for the {@link Ports#getSerfWan() serfWan} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for serfWan * @return A modified copy of the {@code this} object */ public final ImmutablePorts withSerfWan(int value) { if (this.serfWan == value) return this; return new ImmutablePorts(this.dns, this.http, this.rpc, this.serfLan, value, this.server); }
/** * Builds a new {@link ImmutablePorts ImmutablePorts}. * @return An immutable instance of Ports * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutablePorts build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutablePorts(dns, http, rpc, serfLan, serfWan, server); }