Package io.substrait.expression
Class ImmutableExpression.Switch
java.lang.Object
io.substrait.expression.Expression.Switch
io.substrait.expression.ImmutableExpression.Switch
- All Implemented Interfaces:
Expression,FunctionArg
- Enclosing class:
- ImmutableExpression
Immutable implementation of
Expression.Switch.
Use the builder to create immutable instances:
ImmutableExpression.Switch.builder().
-
Nested Class Summary
Nested ClassesNested 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 forSwitch.static ImmutableExpression.SwitchcopyOf(Expression.Switch instance) Creates an immutable copy of aExpression.Switchvalue.booleanThis instance is equal to all instances ofSwitchthat have equal attribute values.inthashCode()Computes a hash code from attributes:match,switchClauses,defaultClause.match()toString()Prints the immutable valueSwitchwith attribute values.withDefaultClause(Expression value) Copy the current immutable object by setting a value for thedefaultClauseattribute.withMatch(Expression value) Copy the current immutable object by setting a value for thematchattribute.withSwitchClauses(Expression.SwitchClause... elements) Copy the current immutable object with elements that replace the content ofswitchClauses.withSwitchClauses(Iterable<? extends Expression.SwitchClause> elements) Copy the current immutable object with elements that replace the content ofswitchClauses.Methods inherited from class io.substrait.expression.Expression.Switch
accept, getTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.substrait.expression.Expression
accept
-
Method Details
-
match
- Specified by:
matchin classExpression.Switch- Returns:
- The value of the
matchattribute
-
switchClauses
- Specified by:
switchClausesin classExpression.Switch- Returns:
- The value of the
switchClausesattribute
-
defaultClause
- Specified by:
defaultClausein classExpression.Switch- Returns:
- The value of the
defaultClauseattribute
-
withMatch
Copy the current immutable object by setting a value for thematchattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for match- Returns:
- A modified copy or the
thisobject
-
withSwitchClauses
Copy the current immutable object with elements that replace the content ofswitchClauses.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withSwitchClauses
public final ImmutableExpression.Switch withSwitchClauses(Iterable<? extends Expression.SwitchClause> elements) Copy the current immutable object with elements that replace the content ofswitchClauses. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of switchClauses elements to set- Returns:
- A modified copy or
thisif not changed
-
withDefaultClause
Copy the current immutable object by setting a value for thedefaultClauseattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for defaultClause- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofSwitchthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:match,switchClauses,defaultClause. -
toString
Prints the immutable valueSwitchwith attribute values. -
copyOf
Creates an immutable copy of aExpression.Switchvalue. 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 Switch instance
-
builder
Creates a builder forSwitch.ImmutableExpression.Switch.builder() .match(io.substrait.expression.Expression) // requiredmatch.addSwitchClauses|addAllSwitchClauses(io.substrait.expression.Expression.SwitchClause) //switchClauseselements .defaultClause(io.substrait.expression.Expression) // requireddefaultClause.build();- Returns:
- A new Switch builder
-