Class ImmutableExtensionWrite

All Implemented Interfaces:
HasExtension, Rel

public final class ImmutableExtensionWrite extends ExtensionWrite
Immutable implementation of ExtensionWrite.

Use the builder to create immutable instances: ImmutableExtensionWrite.builder().

  • Method Details

    • getExtension

      public Optional<AdvancedExtension> getExtension()
      Returns:
      the AdvancedExtension associated directly with the class
    • getRemap

      public Optional<Rel.Remap> getRemap()
      Returns:
      The value of the remap attribute
    • getCommonExtension

      public Optional<AdvancedExtension> getCommonExtension()
      Returns:
      the AdvancedExtension associated with a RelCommon message, if present
    • getHint

      public Optional<Hint> getHint()
      Returns:
      The value of the hint attribute
    • getInput

      public Rel getInput()
      Specified by:
      getInput in class SingleInputRel
      Returns:
      The value of the input attribute
    • getTableSchema

      public NamedStruct getTableSchema()
      Returns the target table schema (names + types).
      Specified by:
      getTableSchema in class AbstractWriteRel
      Returns:
      target table NamedStruct
    • getOperation

      public AbstractWriteRel.WriteOp getOperation()
      Returns the write operation (insert/delete/update/ctas).
      Specified by:
      getOperation in class AbstractWriteRel
      Returns:
      write operation
    • getCreateMode

      public AbstractWriteRel.CreateMode getCreateMode()
      Returns the table creation behavior when the target exists.
      Specified by:
      getCreateMode in class AbstractWriteRel
      Returns:
      create mode
    • getOutputMode

      public AbstractWriteRel.OutputMode getOutputMode()
      Returns the output behavior of the write (e.g., rows returned).
      Specified by:
      getOutputMode in class AbstractWriteRel
      Returns:
      output mode
    • getDetail

      public Extension.WriteExtensionObject getDetail()
      Specified by:
      getDetail in class ExtensionWrite
      Returns:
      The value of the detail attribute
    • withExtension

      public final ImmutableExtensionWrite withExtension(AdvancedExtension value)
      Copy the current immutable object by setting a present value for the optional extension attribute.
      Parameters:
      value - The value for extension
      Returns:
      A modified copy or this if not changed
    • withExtension

      public final ImmutableExtensionWrite withExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the extension attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for extension
      Returns:
      A modified copy or this if not changed
    • withRemap

      public final ImmutableExtensionWrite withRemap(Rel.Remap value)
      Copy the current immutable object by setting a present value for the optional remap attribute.
      Parameters:
      value - The value for remap
      Returns:
      A modified copy or this if not changed
    • withRemap

      public final ImmutableExtensionWrite withRemap(Optional<? extends Rel.Remap> optional)
      Copy the current immutable object by setting an optional value for the remap attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for remap
      Returns:
      A modified copy or this if not changed
    • withCommonExtension

      public final ImmutableExtensionWrite withCommonExtension(AdvancedExtension value)
      Copy the current immutable object by setting a present value for the optional commonExtension attribute.
      Parameters:
      value - The value for commonExtension
      Returns:
      A modified copy or this if not changed
    • withCommonExtension

      public final ImmutableExtensionWrite withCommonExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the commonExtension attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for commonExtension
      Returns:
      A modified copy or this if not changed
    • withHint

      public final ImmutableExtensionWrite withHint(Hint value)
      Copy the current immutable object by setting a present value for the optional hint attribute.
      Parameters:
      value - The value for hint
      Returns:
      A modified copy or this if not changed
    • withHint

      public final ImmutableExtensionWrite withHint(Optional<? extends Hint> optional)
      Copy the current immutable object by setting an optional value for the hint attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for hint
      Returns:
      A modified copy or this if not changed
    • withInput

      public final ImmutableExtensionWrite withInput(Rel value)
      Copy the current immutable object by setting a value for the input attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for input
      Returns:
      A modified copy or the this object
    • withTableSchema

      public final ImmutableExtensionWrite withTableSchema(NamedStruct value)
      Copy the current immutable object by setting a value for the tableSchema attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tableSchema
      Returns:
      A modified copy or the this object
    • withOperation

      public final ImmutableExtensionWrite withOperation(AbstractWriteRel.WriteOp value)
      Copy the current immutable object by setting a value for the operation attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for operation
      Returns:
      A modified copy or the this object
    • withCreateMode

      public final ImmutableExtensionWrite withCreateMode(AbstractWriteRel.CreateMode value)
      Copy the current immutable object by setting a value for the createMode attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for createMode
      Returns:
      A modified copy or the this object
    • withOutputMode

      public final ImmutableExtensionWrite withOutputMode(AbstractWriteRel.OutputMode value)
      Copy the current immutable object by setting a value for the outputMode attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for outputMode
      Returns:
      A modified copy or the this object
    • withDetail

      Copy the current immutable object by setting a value for the detail attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for detail
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableExtensionWrite that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: extension, remap, commonExtension, hint, input, tableSchema, operation, createMode, outputMode, detail.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ExtensionWrite with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableExtensionWrite copyOf(ExtensionWrite instance)
      Creates an immutable copy of a ExtensionWrite value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ExtensionWrite instance
    • builder

      public static ImmutableExtensionWrite.Builder builder()
      Creates a builder for ImmutableExtensionWrite.
       ImmutableExtensionWrite.builder()
          .extension(Optional<io.substrait.extension.AdvancedExtension>) // optional extension
          .remap(Optional<io.substrait.relation.Rel.Remap>) // optional remap
          .commonExtension(Optional<io.substrait.extension.AdvancedExtension>) // optional commonExtension
          .hint(Optional<io.substrait.hint.Hint>) // optional hint
          .input(io.substrait.relation.Rel) // required input
          .tableSchema(io.substrait.type.NamedStruct) // required tableSchema
          .operation(io.substrait.relation.AbstractWriteRel.WriteOp) // required operation
          .createMode(io.substrait.relation.AbstractWriteRel.CreateMode) // required createMode
          .outputMode(io.substrait.relation.AbstractWriteRel.OutputMode) // required outputMode
          .detail(io.substrait.relation.Extension.WriteExtensionObject) // required detail
          .build();
       
      Returns:
      A new ImmutableExtensionWrite builder