Class SyntaxElement
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
- All Implemented Interfaces:
ToCondition,ToExpression
- Direct Known Subclasses:
Condition,Expression,Parameter
A class that is coercible into
Conditions and Expressions for
use in composing rule-sets in code.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanEqualsbooleanEqual(boolean value) Returns a BooleanEquals expression comparing this expression to the provided boolean value.final GetAttrReturns a GetAttr function containing the given path string.final GetAttrgetAttr(Identifier path) Returns a GetAttr function containing the given identifier.final IsSetisSet()Returns an IsSet expression for this instance.final IsValidHostLabelisValidHostLabel(boolean allowDots) Returns an isValidHostLabel expression of this expression.final Notnot()Returns a Not expression of this instance.final ParseUrlparseUrl()Returns a parseUrl expression of this expression.final StringEqualsstringEqual(String value) Returns a StringEquals function of this expression and the given string value.final Substringsubstring(int startIndex, int stopIndex, boolean reverse) Returns a Substring expression of this expression.template()Converts this expression to a string template.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition, toCondition, toConditionBuilderMethods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToExpression
toExpression
-
Constructor Details
-
SyntaxElement
public SyntaxElement()
-
-
Method Details
-
booleanEqual
Returns a BooleanEquals expression comparing this expression to the provided boolean value.- Parameters:
value- the value to compare against.- Returns:
- the
BooleanEqualsfunction.
-
stringEqual
Returns a StringEquals function of this expression and the given string value.- Parameters:
value- the string value to compare this expression to.- Returns:
- the
StringEqualsfunction.
-
getAttr
Returns a GetAttr function containing the given path string.- Parameters:
path- the path.- Returns:
- the
GetAttrfunction.
-
getAttr
Returns a GetAttr function containing the given identifier.- Parameters:
path- the path.- Returns:
- the
GetAttrfunction.
-
isSet
Returns an IsSet expression for this instance.- Returns:
- the
IsSetfunction.
-
isValidHostLabel
Returns an isValidHostLabel expression of this expression.- Parameters:
allowDots- whether the UTF-8.is considered valid within a host label.- Returns:
- the
IsValidHostLabelfunction.
-
not
Returns a Not expression of this instance.- Returns:
- the
Notfunction.
-
parseUrl
Returns a parseUrl expression of this expression.- Returns:
- the
ParseUrlfunction.
-
substring
Returns a Substring expression of this expression.- Parameters:
startIndex- the starting index of the string.stopIndex- the ending index of the string.reverse- whether the indexing is should start from end of the string to start.- Returns:
- the
Substringfunction.
-
template
Converts this expression to a string template. By default, this implementation returns aRuntimeException.- Returns:
- the String template.
-