Class ImmutableTypeExpression.IfOperation

All Implemented Interfaces:
TypeExpression
Enclosing class:
ImmutableTypeExpression

public static final class ImmutableTypeExpression.IfOperation extends TypeExpression.IfOperation
Immutable implementation of TypeExpression.IfOperation.

Use the builder to create immutable instances: ImmutableTypeExpression.IfOperation.builder().

  • Method Details

    • ifCondition

      public TypeExpression ifCondition()
      Specified by:
      ifCondition in class TypeExpression.IfOperation
      Returns:
      The value of the ifCondition attribute
    • thenExpr

      public TypeExpression thenExpr()
      Specified by:
      thenExpr in class TypeExpression.IfOperation
      Returns:
      The value of the thenExpr attribute
    • elseExpr

      public TypeExpression elseExpr()
      Specified by:
      elseExpr in class TypeExpression.IfOperation
      Returns:
      The value of the elseExpr attribute
    • withIfCondition

      public final ImmutableTypeExpression.IfOperation withIfCondition(TypeExpression value)
      Copy the current immutable object by setting a value for the ifCondition attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ifCondition
      Returns:
      A modified copy or the this object
    • withThenExpr

      public final ImmutableTypeExpression.IfOperation withThenExpr(TypeExpression value)
      Copy the current immutable object by setting a value for the thenExpr attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for thenExpr
      Returns:
      A modified copy or the this object
    • withElseExpr

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

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

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

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

      Creates a builder for IfOperation.
       ImmutableTypeExpression.IfOperation.builder()
          .ifCondition(io.substrait.function.TypeExpression) // required ifCondition
          .thenExpr(io.substrait.function.TypeExpression) // required thenExpr
          .elseExpr(io.substrait.function.TypeExpression) // required elseExpr
          .build();
       
      Returns:
      A new IfOperation builder