Class Condition
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.rule.Condition
- All Implemented Interfaces:
FromSourceLocation,ToNode,Into<Condition>,IntoSelf<Condition>,TypeCheck
public final class Condition
extends Object
implements TypeCheck, FromSourceLocation, ToNode, IntoSelf<Condition>
A condition is call to a rule-set function that used to determine whether a rule should be executed.
Can assign the results of functions to new parameters within the current scope.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ConditionConstructs a condition from the given node.getFn()Get the identifier of the parameter that the result is assigned to.Gets the source location of a value.inthashCode()Converts this condition to an expression reference if the condition has a result assignment.toNode()Converts a value to aNode.toString()
-
Field Details
-
ASSIGN
- See Also:
-
-
Method Details
-
fromNode
Constructs a condition from the given node.- Parameters:
node- the node.- Returns:
- the condition instance.
-
equals
-
hashCode
public int hashCode() -
getFn
-
getSourceLocation
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
getResult
Get the identifier of the parameter that the result is assigned to.- Returns:
- the optional identifier.
-
typeCheck
-
toString
-
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
toExpression
Converts this condition to an expression reference if the condition has a result assignment. Otherwise throws an exception.- Returns:
- the result as a reference expression.
-