Class ImmutableExpression.SwitchClause

java.lang.Object
io.substrait.expression.Expression.SwitchClause
io.substrait.expression.ImmutableExpression.SwitchClause
Enclosing class:
ImmutableExpression

public static final class ImmutableExpression.SwitchClause extends Expression.SwitchClause
Immutable implementation of Expression.SwitchClause.

Use the builder to create immutable instances: ImmutableExpression.SwitchClause.builder().

  • Method Details

    • condition

      public Expression.Literal condition()
      Specified by:
      condition in class Expression.SwitchClause
      Returns:
      The value of the condition attribute
    • then

      public Expression then()
      Specified by:
      then in class Expression.SwitchClause
      Returns:
      The value of the then attribute
    • withCondition

      public final ImmutableExpression.SwitchClause withCondition(Expression.Literal value)
      Copy the current immutable object by setting a value for the condition attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for condition
      Returns:
      A modified copy or the this object
    • withThen

      public final ImmutableExpression.SwitchClause withThen(Expression value)
      Copy the current immutable object by setting a value for the then attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for then
      Returns:
      A modified copy or the this object
    • equals

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

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

      Creates an immutable copy of a Expression.SwitchClause 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 SwitchClause instance
    • builder

      Creates a builder for SwitchClause.
       ImmutableExpression.SwitchClause.builder()
          .condition(io.substrait.expression.Expression.Literal) // required condition
          .then(io.substrait.expression.Expression) // required then
          .build();
       
      Returns:
      A new SwitchClause builder