Package io.substrait.expression
Class ImmutableExpression.Switch.Builder
java.lang.Object
io.substrait.expression.ImmutableExpression.Switch.Builder
- Enclosing class:
- ImmutableExpression.Switch
-
Method Summary
Modifier and TypeMethodDescriptionaddAllSwitchClauses(Iterable<? extends Expression.SwitchClause> elements) Adds elements toswitchClauseslist.addSwitchClauses(Expression.SwitchClause element) Adds one element toswitchClauseslist.addSwitchClauses(Expression.SwitchClause... elements) Adds elements toswitchClauseslist.build()Builds a newSwitch.defaultClause(Expression defaultClause) Initializes the value for thedefaultClauseattribute.from(Expression.Switch instance) Fill a builder with attribute values from the providedSwitchinstance.match(Expression match) Initializes the value for thematchattribute.switchClauses(Iterable<? extends Expression.SwitchClause> elements) Sets or replaces all elements forswitchClauseslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedSwitchinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
match
Initializes the value for thematchattribute.- Parameters:
match- The value for match- Returns:
thisbuilder for use in a chained invocation
-
addSwitchClauses
Adds one element toswitchClauseslist.- Parameters:
element- A switchClauses element- Returns:
thisbuilder for use in a chained invocation
-
addSwitchClauses
public final ImmutableExpression.Switch.Builder addSwitchClauses(Expression.SwitchClause... elements) Adds elements toswitchClauseslist.- Parameters:
elements- An array of switchClauses elements- Returns:
thisbuilder for use in a chained invocation
-
switchClauses
public final ImmutableExpression.Switch.Builder switchClauses(Iterable<? extends Expression.SwitchClause> elements) Sets or replaces all elements forswitchClauseslist.- Parameters:
elements- An iterable of switchClauses elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSwitchClauses
public final ImmutableExpression.Switch.Builder addAllSwitchClauses(Iterable<? extends Expression.SwitchClause> elements) Adds elements toswitchClauseslist.- Parameters:
elements- An iterable of switchClauses elements- Returns:
thisbuilder for use in a chained invocation
-
defaultClause
Initializes the value for thedefaultClauseattribute.- Parameters:
defaultClause- The value for defaultClause- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newSwitch.- Returns:
- An immutable instance of Switch
- Throws:
IllegalStateException- if any required attributes are missing
-