private Object readResolve() throws ObjectStreamException { return validate(this); }
/** * Copy the current immutable object by setting an optional value for the {@link IntegrationRuntime#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 ImmutableIntegrationRuntime withId(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.id, value)) return this; return validate(new ImmutableIntegrationRuntime(this, this.state, this.integration, this.environment, value)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link IntegrationRuntime#getId() id} attribute. * @param value The value for id * @return A modified copy of {@code this} object */ public final ImmutableIntegrationRuntime withId(String value) { @Nullable String newValue = Objects.requireNonNull(value, "id"); if (Objects.equals(this.id, newValue)) return this; return validate(new ImmutableIntegrationRuntime(this, this.state, this.integration, this.environment, newValue)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationRuntime#getState() state} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for state (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationRuntime withState(String value) { if (Objects.equals(this.state, value)) return this; return validate(new ImmutableIntegrationRuntime(this, value, this.integration, this.environment, this.id)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationRuntime#getIntegration() integration} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for integration (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationRuntime withIntegration(Integration value) { if (this.integration == value) return this; return validate(new ImmutableIntegrationRuntime(this, this.state, value, this.environment, this.id)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationRuntime#getEnvironment() environment} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for environment (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationRuntime withEnvironment(Environment value) { if (this.environment == value) return this; return validate(new ImmutableIntegrationRuntime(this, this.state, this.integration, value, this.id)); }
/** * Construct a new immutable {@code IntegrationRuntime} instance. * @param state The value for the {@code state} attribute * @param integration The value for the {@code integration} attribute * @param environment The value for the {@code environment} attribute * @param id The value for the {@code id} attribute * @return An immutable IntegrationRuntime instance */ public static IntegrationRuntime of(String state, Integration integration, Environment environment, Optional<String> id) { return validate(new ImmutableIntegrationRuntime(state, integration, environment, id)); }