Package io.trino.sql.routine.ir
Record Class IrIf
java.lang.Object
java.lang.Record
io.trino.sql.routine.ir.IrIf
- All Implemented Interfaces:
IrNode,IrStatement
public record IrIf(RowExpression condition, IrStatement ifTrue, Optional<IrStatement> ifFalse)
extends Record
implements IrStatement
-
Constructor Summary
ConstructorsConstructorDescriptionIrIf(RowExpression condition, IrStatement ifTrue, Optional<IrStatement> ifFalse) Creates an instance of aIrIfrecord class. -
Method Summary
Modifier and TypeMethodDescription<C,R> R accept(IrNodeVisitor<C, R> visitor, C context) Returns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ifFalse()Returns the value of theifFalserecord component.ifTrue()Returns the value of theifTruerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IrIf
Creates an instance of aIrIfrecord class.- Parameters:
condition- the value for theconditionrecord componentifTrue- the value for theifTruerecord componentifFalse- the value for theifFalserecord component
-
-
Method Details
-
accept
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-
ifTrue
Returns the value of theifTruerecord component.- Returns:
- the value of the
ifTruerecord component
-
ifFalse
Returns the value of theifFalserecord component.- Returns:
- the value of the
ifFalserecord component
-