private Object readResolve() throws ObjectStreamException { return validate(this); }
/** * Construct a new immutable {@code StepDescriptor} instance. * @param kind The value for the {@code kind} attribute * @param entrypoint The value for the {@code entrypoint} attribute * @param resource The value for the {@code resource} attribute * @param inputDataShape The value for the {@code inputDataShape} attribute * @param outputDataShape The value for the {@code outputDataShape} attribute * @param propertyDefinitionSteps The value for the {@code propertyDefinitionSteps} attribute * @return An immutable StepDescriptor instance */ public static StepDescriptor of(StepAction.Kind kind, String entrypoint, String resource, Optional<DataShape> inputDataShape, Optional<DataShape> outputDataShape, Iterable<? extends ActionDescriptor.ActionDescriptorStep> propertyDefinitionSteps) { return validate(new ImmutableStepDescriptor(kind, entrypoint, resource, inputDataShape, outputDataShape, propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link StepDescriptor#getInputDataShape() inputDataShape} attribute. * @param value The value for inputDataShape * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withInputDataShape(DataShape value) { @Nullable DataShape newValue = Objects.requireNonNull(value, "inputDataShape"); if (this.inputDataShape == newValue) return this; return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, newValue, this.outputDataShape, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting a value for the {@link StepDescriptor#getEntrypoint() entrypoint} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for entrypoint (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableStepDescriptor withEntrypoint(String value) { if (Objects.equals(this.entrypoint, value)) return this; return validate(new ImmutableStepDescriptor( this, this.kind, value, this.resource, this.inputDataShape, this.outputDataShape, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting a value for the {@link StepDescriptor#getResource() resource} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for resource (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableStepDescriptor withResource(String value) { if (Objects.equals(this.resource, value)) return this; return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, value, this.inputDataShape, this.outputDataShape, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting an optional value for the {@link StepDescriptor#getOutputDataShape() outputDataShape} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for outputDataShape * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withOutputDataShape(Optional<? extends DataShape> optional) { @Nullable DataShape value = optional.orElse(null); if (this.outputDataShape == value) return this; return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, this.inputDataShape, value, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting an optional value for the {@link StepDescriptor#getInputDataShape() inputDataShape} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for inputDataShape * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withInputDataShape(Optional<? extends DataShape> optional) { @Nullable DataShape value = optional.orElse(null); if (this.inputDataShape == value) return this; return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, value, this.outputDataShape, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting a value for the {@link StepDescriptor#getKind() kind} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for kind (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableStepDescriptor withKind(StepAction.Kind value) { if (this.kind == value) return this; return validate(new ImmutableStepDescriptor( this, value, this.entrypoint, this.resource, this.inputDataShape, this.outputDataShape, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link StepDescriptor#getOutputDataShape() outputDataShape} attribute. * @param value The value for outputDataShape * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withOutputDataShape(DataShape value) { @Nullable DataShape newValue = Objects.requireNonNull(value, "outputDataShape"); if (this.outputDataShape == newValue) return this; return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, this.inputDataShape, newValue, this.propertyDefinitionSteps)); }
/** * Copy the current immutable object with elements that replace the content of {@link StepDescriptor#getPropertyDefinitionSteps() propertyDefinitionSteps}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withPropertyDefinitionSteps(ActionDescriptor.ActionDescriptorStep... elements) { List<ActionDescriptor.ActionDescriptorStep> newValue = createUnmodifiableList(false, createSafeList(Arrays.asList(elements), true, false)); return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, this.inputDataShape, this.outputDataShape, newValue)); }
/** * Copy the current immutable object with elements that replace the content of {@link StepDescriptor#getPropertyDefinitionSteps() propertyDefinitionSteps}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of propertyDefinitionSteps elements to set * @return A modified copy of {@code this} object */ public final ImmutableStepDescriptor withPropertyDefinitionSteps(Iterable<? extends ActionDescriptor.ActionDescriptorStep> elements) { if (this.propertyDefinitionSteps == elements) return this; List<ActionDescriptor.ActionDescriptorStep> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return validate(new ImmutableStepDescriptor( this, this.kind, this.entrypoint, this.resource, this.inputDataShape, this.outputDataShape, newValue)); }