Package io.substrait.expression
Class ImmutableFieldReference
java.lang.Object
io.substrait.expression.FieldReference
io.substrait.expression.ImmutableFieldReference
- All Implemented Interfaces:
Expression,FunctionArg
Immutable implementation of
FieldReference.
Use the builder to create immutable instances:
ImmutableFieldReference.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableFieldReference.Nested classes/interfaces inherited from class io.substrait.expression.FieldReference
FieldReference.ListElement, FieldReference.MapKey, FieldReference.ReferenceSegment, FieldReference.StructFieldNested classes/interfaces inherited from interface io.substrait.expression.Expression
Expression.AggregationInvocation, Expression.AggregationPhase, Expression.BinaryLiteral, Expression.BoolLiteral, Expression.Cast, Expression.DateLiteral, Expression.DecimalLiteral, Expression.EmptyListLiteral, Expression.EmptyMapLiteral, Expression.FailureBehavior, Expression.FixedBinaryLiteral, Expression.FixedCharLiteral, Expression.FP32Literal, Expression.FP64Literal, Expression.I16Literal, Expression.I32Literal, Expression.I64Literal, Expression.I8Literal, Expression.IfClause, Expression.IfThen, Expression.InPredicate, Expression.IntervalCompoundLiteral, Expression.IntervalDayLiteral, Expression.IntervalYearLiteral, Expression.Lambda, Expression.ListLiteral, Expression.Literal, Expression.MapLiteral, Expression.MultiOrList, Expression.MultiOrListRecord, Expression.Nested, Expression.NestedList, Expression.NestedStruct, Expression.NullLiteral, Expression.PrecisionTimeLiteral, Expression.PrecisionTimestampLiteral, Expression.PrecisionTimestampTZLiteral, Expression.PredicateOp, Expression.ScalarFunctionInvocation, Expression.ScalarSubquery, Expression.SetPredicate, Expression.SingleOrList, Expression.SortDirection, Expression.SortField, Expression.StrLiteral, Expression.StructLiteral, Expression.Subquery, Expression.Switch, Expression.SwitchClause, Expression.TimeLiteral, Expression.TimestampLiteral, Expression.TimestampTZLiteral, Expression.UserDefinedAnyLiteral, Expression.UserDefinedLiteral, Expression.UserDefinedStructLiteral, Expression.UUIDLiteral, Expression.VarCharLiteral, Expression.WindowBoundsType, Expression.WindowFunctionInvocationNested classes/interfaces inherited from interface io.substrait.expression.FunctionArg
FunctionArg.FuncArgVisitor<R,C extends VisitationContext, E extends Throwable>, FunctionArg.ProtoFrom -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableFieldReference.static ImmutableFieldReferencecopyOf(FieldReference instance) Creates an immutable copy of aFieldReferencevalue.booleanThis instance is equal to all instances ofImmutableFieldReferencethat have equal attribute values.inthashCode()Computes a hash code from attributes:segments,type,inputExpression,outerReferenceStepsOut,lambdaParameterReferenceStepsOut.segments()toString()Prints the immutable valueFieldReferencewith attribute values.type()final ImmutableFieldReferencewithInputExpression(Expression value) Copy the current immutable object by setting a present value for the optionalinputExpressionattribute.final ImmutableFieldReferencewithInputExpression(Optional<? extends Expression> optional) Copy the current immutable object by setting an optional value for theinputExpressionattribute.final ImmutableFieldReferencewithLambdaParameterReferenceStepsOut(int value) Copy the current immutable object by setting a present value for the optionallambdaParameterReferenceStepsOutattribute.final ImmutableFieldReferencewithLambdaParameterReferenceStepsOut(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thelambdaParameterReferenceStepsOutattribute.final ImmutableFieldReferencewithOuterReferenceStepsOut(int value) Copy the current immutable object by setting a present value for the optionalouterReferenceStepsOutattribute.final ImmutableFieldReferencewithOuterReferenceStepsOut(Optional<Integer> optional) Copy the current immutable object by setting an optional value for theouterReferenceStepsOutattribute.final ImmutableFieldReferencewithSegments(FieldReference.ReferenceSegment... elements) Copy the current immutable object with elements that replace the content ofsegments.final ImmutableFieldReferencewithSegments(Iterable<? extends FieldReference.ReferenceSegment> elements) Copy the current immutable object with elements that replace the content ofsegments.final ImmutableFieldReferenceCopy the current immutable object by setting a value for thetypeattribute.Methods inherited from class io.substrait.expression.FieldReference
accept, check, dereferenceList, dereferenceMap, dereferenceStruct, getType, isLambdaParameterReference, isOuterReference, isSimpleRootReference, newInputRelReference, newInputRelReference, newListReference, newMapReference, newRootStructOuterReference, newRootStructReference, newStructReference, ofExpression, ofRootMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.substrait.expression.Expression
accept
-
Method Details
-
segments
- Specified by:
segmentsin classFieldReference- Returns:
- The value of the
segmentsattribute
-
type
- Specified by:
typein classFieldReference- Returns:
- The value of the
typeattribute
-
inputExpression
- Specified by:
inputExpressionin classFieldReference- Returns:
- The value of the
inputExpressionattribute
-
outerReferenceStepsOut
- Specified by:
outerReferenceStepsOutin classFieldReference- Returns:
- The value of the
outerReferenceStepsOutattribute
-
lambdaParameterReferenceStepsOut
- Specified by:
lambdaParameterReferenceStepsOutin classFieldReference- Returns:
- The value of the
lambdaParameterReferenceStepsOutattribute
-
withSegments
Copy the current immutable object with elements that replace the content ofsegments.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSegments
public final ImmutableFieldReference withSegments(Iterable<? extends FieldReference.ReferenceSegment> elements) Copy the current immutable object with elements that replace the content ofsegments. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of segments elements to set- Returns:
- A modified copy or
thisif not changed
-
withType
Copy the current immutable object by setting a value for thetypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy or the
thisobject
-
withInputExpression
Copy the current immutable object by setting a present value for the optionalinputExpressionattribute.- Parameters:
value- The value for inputExpression- Returns:
- A modified copy or
thisif not changed
-
withInputExpression
Copy the current immutable object by setting an optional value for theinputExpressionattribute. 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 inputExpression- Returns:
- A modified copy or
thisif not changed
-
withOuterReferenceStepsOut
Copy the current immutable object by setting a present value for the optionalouterReferenceStepsOutattribute.- Parameters:
value- The value for outerReferenceStepsOut- Returns:
- A modified copy or
thisif not changed
-
withOuterReferenceStepsOut
Copy the current immutable object by setting an optional value for theouterReferenceStepsOutattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for outerReferenceStepsOut- Returns:
- A modified copy or
thisif not changed
-
withLambdaParameterReferenceStepsOut
Copy the current immutable object by setting a present value for the optionallambdaParameterReferenceStepsOutattribute.- Parameters:
value- The value for lambdaParameterReferenceStepsOut- Returns:
- A modified copy or
thisif not changed
-
withLambdaParameterReferenceStepsOut
public final ImmutableFieldReference withLambdaParameterReferenceStepsOut(Optional<Integer> optional) Copy the current immutable object by setting an optional value for thelambdaParameterReferenceStepsOutattribute. An equality check is used on inner value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for lambdaParameterReferenceStepsOut- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableFieldReferencethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:segments,type,inputExpression,outerReferenceStepsOut,lambdaParameterReferenceStepsOut. -
toString
Prints the immutable valueFieldReferencewith attribute values. -
copyOf
Creates an immutable copy of aFieldReferencevalue. 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 FieldReference instance
-
builder
Creates a builder forImmutableFieldReference.ImmutableFieldReference.builder() .addSegments|addAllSegments(io.substrait.expression.FieldReference.ReferenceSegment) //segmentselements .type(io.substrait.type.Type) // requiredtype.inputExpression(Optional<io.substrait.expression.Expression>) // optionalinputExpression.outerReferenceStepsOut(Optional<Integer>) // optionalouterReferenceStepsOut.lambdaParameterReferenceStepsOut(Optional<Integer>) // optionallambdaParameterReferenceStepsOut.build();- Returns:
- A new ImmutableFieldReference builder
-