Class ImmutableNamedUpdate

All Implemented Interfaces:
HasExtension, Rel

public final class ImmutableNamedUpdate extends NamedUpdate
Immutable implementation of NamedUpdate.

Use the builder to create immutable instances: ImmutableNamedUpdate.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
    • getTableSchema

      public NamedStruct getTableSchema()
      Returns the schema of the target table.
      Specified by:
      getTableSchema in class AbstractUpdate
      Returns:
      table schema as NamedStruct
    • getCondition

      public Expression getCondition()
      Returns the condition that determines which rows to update.
      Specified by:
      getCondition in class AbstractUpdate
      Returns:
      update condition expression
    • getTransformations

      public List<AbstractUpdate.TransformExpression> getTransformations()
      Returns the list of column transformations to apply.
      Specified by:
      getTransformations in class AbstractUpdate
      Returns:
      list of AbstractUpdate.TransformExpression
    • getNames

      public List<String> getNames()
      Specified by:
      getNames in class NamedUpdate
      Returns:
      The value of the names attribute
    • withExtension

      public final ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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 ImmutableNamedUpdate 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
    • withTableSchema

      public final ImmutableNamedUpdate 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
    • withCondition

      public final ImmutableNamedUpdate withCondition(Expression value)
      Copy the current immutable object by setting a value for the condition attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for condition
      Returns:
      A modified copy or the this object
    • withTransformations

      public final ImmutableNamedUpdate withTransformations(AbstractUpdate.TransformExpression... elements)
      Copy the current immutable object with elements that replace the content of transformations.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withTransformations

      public final ImmutableNamedUpdate withTransformations(Iterable<? extends AbstractUpdate.TransformExpression> elements)
      Copy the current immutable object with elements that replace the content of transformations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of transformations elements to set
      Returns:
      A modified copy or this if not changed
    • withNames

      public final ImmutableNamedUpdate withNames(String... elements)
      Copy the current immutable object with elements that replace the content of names.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withNames

      public final ImmutableNamedUpdate withNames(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of names. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of names elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableNamedUpdate 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, tableSchema, condition, transformations, names.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableNamedUpdate copyOf(NamedUpdate instance)
      Creates an immutable copy of a NamedUpdate 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 NamedUpdate instance
    • builder

      public static ImmutableNamedUpdate.Builder builder()
      Creates a builder for ImmutableNamedUpdate.
       ImmutableNamedUpdate.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
          .tableSchema(io.substrait.type.NamedStruct) // required tableSchema
          .condition(io.substrait.expression.Expression) // required condition
          .addTransformations|addAllTransformations(io.substrait.relation.AbstractUpdate.TransformExpression) // transformations elements
          .addNames|addAllNames(String) // names elements
          .build();
       
      Returns:
      A new ImmutableNamedUpdate builder