private Object readResolve() throws ObjectStreamException { return validate(this); }
/** * Copy the current immutable object by setting an optional value for the {@link ConnectorGroup#getId() id} attribute. * An equality check is used on inner nullable value to prevent copying of the same value by returning {@code this}. * @param optional A value for id * @return A modified copy of {@code this} object */ public final ImmutableConnectorGroup withId(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.id, value)) return this; return validate(new ImmutableConnectorGroup(this, value, this.name)); }
/** * Copy the current immutable object by setting a value for the {@link ConnectorGroup#getName() name} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for name (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableConnectorGroup withName(String value) { if (Objects.equals(this.name, value)) return this; return validate(new ImmutableConnectorGroup(this, this.id, value)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link ConnectorGroup#getId() id} attribute. * @param value The value for id * @return A modified copy of {@code this} object */ public final ImmutableConnectorGroup withId(String value) { @Nullable String newValue = Objects.requireNonNull(value, "id"); if (Objects.equals(this.id, newValue)) return this; return validate(new ImmutableConnectorGroup(this, newValue, this.name)); }
/** * Construct a new immutable {@code ConnectorGroup} instance. * @param id The value for the {@code id} attribute * @param name The value for the {@code name} attribute * @return An immutable ConnectorGroup instance */ public static ConnectorGroup of(Optional<String> id, String name) { return validate(new ImmutableConnectorGroup(id, name)); }