Package io.micronaut.sourcegen.model
Record Class ExpressionDef.IfElse
java.lang.Object
java.lang.Record
io.micronaut.sourcegen.model.ExpressionDef.IfElse
- Record Components:
condition- The conditionexpression- The expression if the condition is trueelseExpression- The expression if the condition is false
- All Implemented Interfaces:
ExpressionDef
- Enclosing interface:
- ExpressionDef
public static record ExpressionDef.IfElse(ExpressionDef condition, ExpressionDef expression, ExpressionDef elseExpression)
extends Record
implements ExpressionDef
The if-else expression.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.sourcegen.model.ExpressionDef
ExpressionDef.CallInstanceMethod, ExpressionDef.CallStaticMethod, ExpressionDef.Condition, ExpressionDef.Constant, ExpressionDef.Convert, ExpressionDef.IfElse, ExpressionDef.NewArrayInitialized, ExpressionDef.NewArrayOfSize, ExpressionDef.NewInstance, ExpressionDef.Switch, ExpressionDef.SwitchYieldCase -
Constructor Summary
ConstructorsConstructorDescriptionIfElse(ExpressionDef condition, ExpressionDef expression, ExpressionDef elseExpression) Creates an instance of aIfElserecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionrecord component.Returns the value of theelseExpressionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.type()The type of the expression.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.sourcegen.model.ExpressionDef
asCondition, asConditionIf, asConditionIfElse, asConditionIfElse, asExpressionSwitch, asStatementSwitch, convert, field, field, invoke, invoke, invoke, invoke, invoke, isNonNull, isNull, newLocal, newLocal, returning, whileLoop
-
Constructor Details
-
IfElse
Creates an instance of aIfElserecord class.- Parameters:
condition- the value for theconditionrecord componentexpression- the value for theexpressionrecord componentelseExpression- the value for theelseExpressionrecord component
-
-
Method Details
-
type
Description copied from interface:ExpressionDefThe type of the expression.- Specified by:
typein interfaceExpressionDef- Returns:
- The type
-
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
-
expression
Returns the value of theexpressionrecord component.- Returns:
- the value of the
expressionrecord component
-
elseExpression
Returns the value of theelseExpressionrecord component.- Returns:
- the value of the
elseExpressionrecord component
-