Class ImmutableExpression.IfClause

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

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

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

  • Method Details

    • condition

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

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

      public final ImmutableExpression.IfClause withCondition(Expression 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.IfClause 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 IfClause 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 IfClause with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

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

      public static ImmutableExpression.IfClause.Builder builder()
      Creates a builder for IfClause.
       ImmutableExpression.IfClause.builder()
          .condition(io.substrait.expression.Expression) // required condition
          .then(io.substrait.expression.Expression) // required then
          .build();
       
      Returns:
      A new IfClause builder