Class ImmutableExpression.IfThen

java.lang.Object
io.substrait.expression.Expression.IfThen
io.substrait.expression.ImmutableExpression.IfThen
All Implemented Interfaces:
Expression, FunctionArg
Enclosing class:
ImmutableExpression

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

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

  • Method Details

    • ifClauses

      public List<Expression.IfClause> ifClauses()
      Specified by:
      ifClauses in class Expression.IfThen
      Returns:
      The value of the ifClauses attribute
    • elseClause

      public Expression elseClause()
      Specified by:
      elseClause in class Expression.IfThen
      Returns:
      The value of the elseClause attribute
    • withIfClauses

      public final ImmutableExpression.IfThen withIfClauses(Expression.IfClause... elements)
      Copy the current immutable object with elements that replace the content of ifClauses.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withIfClauses

      public final ImmutableExpression.IfThen withIfClauses(Iterable<? extends Expression.IfClause> elements)
      Copy the current immutable object with elements that replace the content of ifClauses. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of ifClauses elements to set
      Returns:
      A modified copy or this if not changed
    • withElseClause

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

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

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

      public static ImmutableExpression.IfThen copyOf(Expression.IfThen instance)
      Creates an immutable copy of a Expression.IfThen 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 IfThen instance
    • builder

      public static ImmutableExpression.IfThen.Builder builder()
      Creates a builder for IfThen.
       ImmutableExpression.IfThen.builder()
          .addIfClauses|addAllIfClauses(io.substrait.expression.Expression.IfClause) // ifClauses elements
          .elseClause(io.substrait.expression.Expression) // required elseClause
          .build();
       
      Returns:
      A new IfThen builder