Package io.substrait.extendedexpression
Class ImmutableExtendedExpression
java.lang.Object
io.substrait.extendedexpression.ExtendedExpression
io.substrait.extendedexpression.ImmutableExtendedExpression
Immutable implementation of
ExtendedExpression.
Use the builder to create immutable instances:
ImmutableExtendedExpression.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableExtendedExpression.Nested classes/interfaces inherited from class io.substrait.extendedexpression.ExtendedExpression
ExtendedExpression.AggregateFunctionReference, ExtendedExpression.ExpressionReference, ExtendedExpression.ExpressionReferenceBase -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableExtendedExpression.static ImmutableExtendedExpressioncopyOf(ExtendedExpression instance) Creates an immutable copy of aExtendedExpressionvalue.booleanThis instance is equal to all instances ofImmutableExtendedExpressionthat have equal attribute values.Returns the optional advanced extension metadata.Returns the base schema associated with this extended expression.Returns the expected type URLs for validation.Returns the list of referred expression references.inthashCode()Computes a hash code from attributes:referredExpressions,baseSchema,expectedTypeUrls,advancedExtension.toString()Prints the immutable valueExtendedExpressionwith attribute values.Copy the current immutable object by setting a present value for the optionaladvancedExtensionattribute.withAdvancedExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theadvancedExtensionattribute.withBaseSchema(NamedStruct value) Copy the current immutable object by setting a value for thebaseSchemaattribute.withExpectedTypeUrls(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.withExpectedTypeUrls(String... elements) Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.Copy the current immutable object with elements that replace the content ofreferredExpressions.withReferredExpressions(Iterable<? extends ExtendedExpression.ExpressionReferenceBase> elements) Copy the current immutable object with elements that replace the content ofreferredExpressions.
-
Method Details
-
getReferredExpressions
Returns the list of referred expression references.- Specified by:
getReferredExpressionsin classExtendedExpression- Returns:
- list of expression references
-
getBaseSchema
Returns the base schema associated with this extended expression.- Specified by:
getBaseSchemain classExtendedExpression- Returns:
- the base schema
-
getExpectedTypeUrls
Returns the expected type URLs for validation.- Specified by:
getExpectedTypeUrlsin classExtendedExpression- Returns:
- list of expected type URLs
-
getAdvancedExtension
Returns the optional advanced extension metadata.- Specified by:
getAdvancedExtensionin classExtendedExpression- Returns:
- optional advanced extension
-
withReferredExpressions
public final ImmutableExtendedExpression withReferredExpressions(ExtendedExpression.ExpressionReferenceBase... elements) Copy the current immutable object with elements that replace the content ofreferredExpressions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withReferredExpressions
public final ImmutableExtendedExpression withReferredExpressions(Iterable<? extends ExtendedExpression.ExpressionReferenceBase> elements) Copy the current immutable object with elements that replace the content ofreferredExpressions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of referredExpressions elements to set- Returns:
- A modified copy or
thisif not changed
-
withBaseSchema
Copy the current immutable object by setting a value for thebaseSchemaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for baseSchema- Returns:
- A modified copy or the
thisobject
-
withExpectedTypeUrls
Copy the current immutable object with elements that replace the content ofexpectedTypeUrls.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withExpectedTypeUrls
Copy the current immutable object with elements that replace the content ofexpectedTypeUrls. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of expectedTypeUrls elements to set- Returns:
- A modified copy or
thisif not changed
-
withAdvancedExtension
Copy the current immutable object by setting a present value for the optionaladvancedExtensionattribute.- Parameters:
value- The value for advancedExtension- Returns:
- A modified copy or
thisif not changed
-
withAdvancedExtension
public final ImmutableExtendedExpression withAdvancedExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theadvancedExtensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for advancedExtension- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableExtendedExpressionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:referredExpressions,baseSchema,expectedTypeUrls,advancedExtension. -
toString
Prints the immutable valueExtendedExpressionwith attribute values. -
copyOf
Creates an immutable copy of aExtendedExpressionvalue. 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
Creates a builder forImmutableExtendedExpression.ImmutableExtendedExpression.builder() .addReferredExpressions|addAllReferredExpressions(io.substrait.extendedexpression.ExtendedExpression.ExpressionReferenceBase) //referredExpressionselements .baseSchema(io.substrait.type.NamedStruct) // requiredbaseSchema.addExpectedTypeUrls|addAllExpectedTypeUrls(String) //expectedTypeUrlselements .advancedExtension(Optional<io.substrait.proto.AdvancedExtension>) // optionaladvancedExtension.build();- Returns:
- A new ImmutableExtendedExpression builder
-