Record Class ConstraintExpr.Comparison
java.lang.Object
java.lang.Record
org.ek9lang.compiler.symbols.ConstraintExpr.Comparison
- Record Components:
operator- one of ==, <>, >, >=, <, <=, matches, containsliteralText- the literal's source text (e.g. "16")literalTypeFqn- the literal's fully qualified type (e.g. "org.ek9.lang::Integer")
- All Implemented Interfaces:
Serializable, ConstraintExpr
- Enclosing interface:
ConstraintExpr
public static record ConstraintExpr.Comparison(String operator, String literalText, String literalTypeFqn)
extends Record
implements ConstraintExpr
A leaf: the implicit subject value compared against a literal via
operator
(default ==; != normalised to <>, matching phase 3 / IR lowering).- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ConstraintExpr
ConstraintExpr.Combination, ConstraintExpr.Comparison -
Constructor Summary
ConstructorsConstructorDescriptionComparison(String operator, String literalText, String literalTypeFqn) Creates an instance of aComparisonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theliteralTextrecord component.Returns the value of theliteralTypeFqnrecord component.operator()Returns the value of theoperatorrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Comparison
Creates an instance of aComparisonrecord class.- Parameters:
operator- the value for theoperatorrecord componentliteralText- the value for theliteralTextrecord componentliteralTypeFqn- the value for theliteralTypeFqnrecord component
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
operator
-
literalText
Returns the value of theliteralTextrecord component.- Returns:
- the value of the
literalTextrecord component
-
literalTypeFqn
Returns the value of theliteralTypeFqnrecord component.- Returns:
- the value of the
literalTypeFqnrecord component
-