Class Condition
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
software.amazon.smithy.rulesengine.language.syntax.rule.Condition
- All Implemented Interfaces:
FromSourceLocation,ToNode,TypeCheck,ToCondition,ToExpression
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 TypeMethodDescriptionstatic Condition.Builderbuilder()Builder to create aConditioninstance.Returns a canonical form of this condition.booleanstatic ConditionConstructs a condition from the given node.static ConditionfromNode(Node node, EndpointComponentFactory factory) Constructs a condition from the given node, resolving any function using the givenEndpointComponentFactory.Gets the function used to express this condition.Get the identifier of the parameter that the result is assigned to.Gets the source location of a value.inthashCode()Convert this into a condition.Convert this into a condition builder for compositional use.Convert this into an expression.toNode()Converts a value to aNode.toString()Checks whether the given types within a scope satisfy the constraints.Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
availableSince, booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substring, templateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition
-
Field Details
-
ASSIGN
- See Also:
-
-
Method Details
-
builder
Builder to create aConditioninstance.- Returns:
- returns a new Builder.
-
fromNode
Constructs a condition from the given node.- Parameters:
node- the node.- Returns:
- the condition instance.
-
fromNode
Constructs a condition from the given node, resolving any function using the givenEndpointComponentFactory. Whenfactoryisnull, the default statically-discovered function factory is used.- Parameters:
node- the node.factory- the factory used to resolve the condition's function, or null.- Returns:
- the condition instance.
-
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.
-
getFunction
Gets the function used to express this condition.- Returns:
- the function for this condition.
-
canonicalize
Returns a canonical form of this condition.- Returns:
- the canonical condition
-
toConditionBuilder
Description copied from interface:ToConditionConvert this into a condition builder for compositional use.- Specified by:
toConditionBuilderin interfaceToCondition- Returns:
- the condition builder.
-
toCondition
Description copied from interface:ToConditionConvert this into a condition.- Specified by:
toConditionin interfaceToCondition- Returns:
- the condition.
-
toExpression
Description copied from interface:ToExpressionConvert this into an expression.- Specified by:
toExpressionin interfaceToExpression- Returns:
- the expression.
-
toBuilder
-
typeCheck
Description copied from interface:TypeCheckChecks whether the given types within a scope satisfy the constraints. -
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
equals
-
hashCode
public int hashCode() -
toString
-