/** * Builds a new {@link IntegrationDeployment IntegrationDeployment}. * @return An immutable instance of IntegrationDeployment * @throws java.lang.IllegalStateException if any required attributes are missing */ public IntegrationDeployment build() { return ImmutableIntegrationDeployment.validate(new ImmutableIntegrationDeployment(this)); }
/** * Construct a new immutable {@code IntegrationDeployment} instance. * @param integrationId The value for the {@code integrationId} attribute * @param spec The value for the {@code spec} attribute * @param userId The value for the {@code userId} attribute * @param currentState The value for the {@code currentState} attribute * @param targetState The value for the {@code targetState} attribute * @param stepsDone The value for the {@code stepsDone} attribute * @param statusMessage The value for the {@code statusMessage} attribute * @param id The value for the {@code id} attribute * @param version The value for the {@code version} attribute * @param createdAt The value for the {@code createdAt} attribute * @param updatedAt The value for the {@code updatedAt} attribute * @return An immutable IntegrationDeployment instance */ public static IntegrationDeployment of(Optional<String> integrationId, Integration spec, Optional<String> userId, IntegrationDeploymentState currentState, IntegrationDeploymentState targetState, Map<String, ? extends String> stepsDone, Optional<String> statusMessage, Optional<String> id, int version, long createdAt, long updatedAt) { return validate(new ImmutableIntegrationDeployment(integrationId, spec, userId, currentState, targetState, stepsDone, statusMessage, id, version, createdAt, updatedAt)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link IntegrationDeployment#getStatusMessage() statusMessage} attribute. * @param value The value for statusMessage * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withStatusMessage(String value) { @Nullable String newValue = Objects.requireNonNull(value, "statusMessage"); if (Objects.equals(this.statusMessage, newValue)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, newValue, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getUpdatedAt() updatedAt} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for updatedAt * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withUpdatedAt(long value) { if (this.updatedAt == value) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, value)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link IntegrationDeployment#getUserId() userId} attribute. * @param value The value for userId * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withUserId(String value) { @Nullable String newValue = Objects.requireNonNull(value, "userId"); if (Objects.equals(this.userId, newValue)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, newValue, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getVersion() version} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for version * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withVersion(int value) { if (this.version == value) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, value, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting an optional value for the {@link IntegrationDeployment#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 ImmutableIntegrationDeployment withId(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.id, value)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, value, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link IntegrationDeployment#getId() id} attribute. * @param value The value for id * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withId(String value) { @Nullable String newValue = Objects.requireNonNull(value, "id"); if (Objects.equals(this.id, newValue)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, newValue, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getSpec() spec} 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 spec (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withSpec(Integration value) { if (this.spec == value) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, value, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getCreatedAt() createdAt} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for createdAt * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withCreatedAt(long value) { if (this.createdAt == value) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, value, this.updatedAt)); }
/** * Copy the current immutable object by setting an optional value for the {@link IntegrationDeployment#getUserId() userId} 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 userId * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withUserId(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.userId, value)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, value, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getIntegrationId() integrationId} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for integrationId * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withIntegrationId(Optional<String> value) { if (this.integrationId.equals(value)) return this; Optional<String> newValue = Objects.requireNonNull(value, "integrationId"); return validate(new ImmutableIntegrationDeployment( this, newValue, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting an optional value for the {@link IntegrationDeployment#getStatusMessage() statusMessage} 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 statusMessage * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withStatusMessage(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.statusMessage, value)) return this; return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, this.stepsDone, value, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getCurrentState() currentState} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for currentState * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withCurrentState(IntegrationDeploymentState value) { if (this.currentState == value) return this; IntegrationDeploymentState newValue = Objects.requireNonNull(value, "currentState"); return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, newValue, this.targetState, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by setting a value for the {@link IntegrationDeployment#getTargetState() targetState} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for targetState * @return A modified copy of the {@code this} object */ public final ImmutableIntegrationDeployment withTargetState(IntegrationDeploymentState value) { if (this.targetState == value) return this; IntegrationDeploymentState newValue = Objects.requireNonNull(value, "targetState"); return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, newValue, this.stepsDone, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }
/** * Copy the current immutable object by replacing the {@link IntegrationDeployment#getStepsDone() stepsDone} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the stepsDone map * @return A modified copy of {@code this} object */ public final ImmutableIntegrationDeployment withStepsDone(Map<String, ? extends String> entries) { if (this.stepsDone == entries) return this; Map<String, String> newValue = createUnmodifiableMap(true, false, entries); return validate(new ImmutableIntegrationDeployment( this, this.integrationId, this.spec, this.userId, this.currentState, this.targetState, newValue, this.statusMessage, this.id, this.version, this.createdAt, this.updatedAt)); }