Record Class Expression
java.lang.Object
java.lang.Record
io.github.brantunger.unruly.api.language.Expression
- Record Components:
ruleName- The rule's namekind- Whether the expression is the rule's condition or its actiontext- The expression's text, never blank when the engine compiles it
One condition or action of a rule, as an
ExpressionCompiler compiles it: which rule it belongs to, whether
it's the condition or the action, and its text. A language can name the rule in its own messages, and tell a
condition from an action without being told separately.-
Constructor Summary
ConstructorsConstructorDescriptionExpression(String ruleName, ExpressionKind kind, String text) Creates an expression. -
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.kind()Returns the value of thekindrecord component.ruleName()Returns the value of theruleNamerecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Expression
Creates an expression.- Throws:
NullPointerException- ifruleName,kindortextisnull
-
-
Method Details
-
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). -
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. -
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. -
ruleName
Returns the value of theruleNamerecord component.- Returns:
- the value of the
ruleNamerecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-