Class ImmutableExtendedExpression

java.lang.Object
io.substrait.extendedexpression.ExtendedExpression
io.substrait.extendedexpression.ImmutableExtendedExpression

public final class ImmutableExtendedExpression extends ExtendedExpression
Immutable implementation of ExtendedExpression.

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

  • Method Details

    • getReferredExpressions

      public List<ExtendedExpression.ExpressionReferenceBase> getReferredExpressions()
      Returns the list of referred expression references.
      Specified by:
      getReferredExpressions in class ExtendedExpression
      Returns:
      list of expression references
    • getBaseSchema

      public NamedStruct getBaseSchema()
      Returns the base schema associated with this extended expression.
      Specified by:
      getBaseSchema in class ExtendedExpression
      Returns:
      the base schema
    • getExpectedTypeUrls

      public List<String> getExpectedTypeUrls()
      Returns the expected type URLs for validation.
      Specified by:
      getExpectedTypeUrls in class ExtendedExpression
      Returns:
      list of expected type URLs
    • getAdvancedExtension

      public Optional<AdvancedExtension> getAdvancedExtension()
      Returns the optional advanced extension metadata.
      Specified by:
      getAdvancedExtension in class ExtendedExpression
      Returns:
      optional advanced extension
    • withReferredExpressions

      public final ImmutableExtendedExpression withReferredExpressions(ExtendedExpression.ExpressionReferenceBase... elements)
      Copy the current immutable object with elements that replace the content of referredExpressions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withReferredExpressions

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

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

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

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

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

      public final ImmutableExtendedExpression withAdvancedExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the advancedExtension 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 advancedExtension
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableExtendedExpression 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: referredExpressions, baseSchema, expectedTypeUrls, advancedExtension.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableExtendedExpression.Builder builder()
      Creates a builder for ImmutableExtendedExpression.
       ImmutableExtendedExpression.builder()
          .addReferredExpressions|addAllReferredExpressions(io.substrait.extendedexpression.ExtendedExpression.ExpressionReferenceBase) // referredExpressions elements
          .baseSchema(io.substrait.type.NamedStruct) // required baseSchema
          .addExpectedTypeUrls|addAllExpectedTypeUrls(String) // expectedTypeUrls elements
          .advancedExtension(Optional<io.substrait.proto.AdvancedExtension>) // optional advancedExtension
          .build();
       
      Returns:
      A new ImmutableExtendedExpression builder