Record Class ConditionCaseDetails
java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.ConditionCaseDetails
public record ConditionCaseDetails(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult, String exceptionType, String exceptionVariable)
extends Record
Record representing a single condition case within a CONTROL_FLOW_CHAIN.
Each condition case represents one evaluation path in the sequential chain: - Question operator: NULL_CHECK case - If statement: Boolean condition evaluation - Switch case: Equality or expression evaluation - Guard conditions: Combined assignment + condition evaluation - Exception handlers: Type-based exception matching (try/catch)
Contains complete evaluation instructions for guard updates, condition checks, and corresponding body execution if the condition matches.
-
Constructor Summary
ConstructorsConstructorDescriptionConditionCaseDetails(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult, String exceptionType, String exceptionVariable) Creates an instance of aConditionCaseDetailsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebodyEvaluationrecord component.Returns the value of thebodyResultrecord component.Returns the value of thebodyScopeIdrecord component.Returns the value of thecaseScopeIdrecord component.caseType()Returns the value of thecaseTyperecord component.Returns the value of theconditionEvaluationrecord component.Returns the value of theconditionResultrecord component.static ConditionCaseDetailscreateExceptionHandler(String catchScopeId, String exceptionType, String exceptionVariable, String catchBodyScopeId, List<IRInstr> catchBodyEvaluation, String catchBodyResult) Create a condition case for exception handlers (try/catch blocks).static ConditionCaseDetailscreateExpression(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for general boolean expressions (if statements).static ConditionCaseDetailscreateLiteral(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for literal value comparison (switch literal cases).static ConditionCaseDetailscreateNullCheck(String caseScopeId, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult) Create a condition case for the Question operator null check.Returns the value of theenumConstantrecord component.intReturns the value of theenumOrdinalrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionTyperecord component.Returns the value of theexceptionVariablerecord component.Returns the value of theguardUpdatesrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theprimitiveConditionrecord component.toString()IR-optimized toString following EK9's bracket-only, no-indentation format.
-
Constructor Details
-
ConditionCaseDetails
public ConditionCaseDetails(String caseScopeId, String caseType, List<IRInstr> guardUpdates, String bodyScopeId, String enumConstant, int enumOrdinal, List<IRInstr> conditionEvaluation, String conditionResult, String primitiveCondition, List<IRInstr> bodyEvaluation, String bodyResult, String exceptionType, String exceptionVariable) Creates an instance of aConditionCaseDetailsrecord class.- Parameters:
caseScopeId- the value for thecaseScopeIdrecord componentcaseType- the value for thecaseTyperecord componentguardUpdates- the value for theguardUpdatesrecord componentbodyScopeId- the value for thebodyScopeIdrecord componentenumConstant- the value for theenumConstantrecord componentenumOrdinal- the value for theenumOrdinalrecord componentconditionEvaluation- the value for theconditionEvaluationrecord componentconditionResult- the value for theconditionResultrecord componentprimitiveCondition- the value for theprimitiveConditionrecord componentbodyEvaluation- the value for thebodyEvaluationrecord componentbodyResult- the value for thebodyResultrecord componentexceptionType- the value for theexceptionTyperecord componentexceptionVariable- the value for theexceptionVariablerecord component
-
-
Method Details
-
createNullCheck
-
createExpression
-
createLiteral
-
createExceptionHandler
public static ConditionCaseDetails createExceptionHandler(String catchScopeId, String exceptionType, String exceptionVariable, String catchBodyScopeId, List<IRInstr> catchBodyEvaluation, String catchBodyResult) Create a condition case for exception handlers (try/catch blocks). Exception handlers match by type rather than Boolean condition evaluation. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
caseScopeId
Returns the value of thecaseScopeIdrecord component.- Returns:
- the value of the
caseScopeIdrecord component
-
caseType
Returns the value of thecaseTyperecord component.- Returns:
- the value of the
caseTyperecord component
-
guardUpdates
-
bodyScopeId
Returns the value of thebodyScopeIdrecord component.- Returns:
- the value of the
bodyScopeIdrecord component
-
enumConstant
Returns the value of theenumConstantrecord component.- Returns:
- the value of the
enumConstantrecord component
-
enumOrdinal
public int enumOrdinal()Returns the value of theenumOrdinalrecord component.- Returns:
- the value of the
enumOrdinalrecord component
-
conditionEvaluation
-
conditionResult
Returns the value of theconditionResultrecord component.- Returns:
- the value of the
conditionResultrecord component
-
primitiveCondition
Returns the value of theprimitiveConditionrecord component.- Returns:
- the value of the
primitiveConditionrecord component
-
bodyEvaluation
-
bodyResult
Returns the value of thebodyResultrecord component.- Returns:
- the value of the
bodyResultrecord component
-
exceptionType
Returns the value of theexceptionTyperecord component.- Returns:
- the value of the
exceptionTyperecord component
-
exceptionVariable
Returns the value of theexceptionVariablerecord component.- Returns:
- the value of the
exceptionVariablerecord component
-