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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Condition.Builder
builder()
Builder to create aCondition
instance.boolean
static Condition
Constructs a condition from the given node.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.int
hashCode()
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
booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substring, template
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition
-
Field Details
-
ASSIGN
- See Also:
-
-
Method Details
-
builder
Builder to create aCondition
instance.- Returns:
- returns a new Builder.
-
fromNode
Constructs a condition from the given node.- Parameters:
node
- the node.- Returns:
- the condition instance.
-
getSourceLocation
Description copied from interface:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in 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.
-
toConditionBuilder
Description copied from interface:ToCondition
Convert this into a condition builder for compositional use.- Specified by:
toConditionBuilder
in interfaceToCondition
- Returns:
- the condition builder.
-
toCondition
Description copied from interface:ToCondition
Convert this into a condition.- Specified by:
toCondition
in interfaceToCondition
- Returns:
- the condition.
-
toExpression
Description copied from interface:ToExpression
Convert this into an expression.- Specified by:
toExpression
in interfaceToExpression
- Returns:
- the expression.
-
toBuilder
-
typeCheck
Description copied from interface:TypeCheck
Checks whether the given types within a scope satisfy the constraints. -
toNode
Description copied from interface:ToNode
Converts a value to aNode
. -
equals
-
hashCode
public int hashCode() -
toString
-