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
Condition
s and Expression
s for
use in composing rule-sets in code.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanEquals
booleanEqual
(boolean value) Returns a BooleanEquals expression comparing this expression to the provided boolean value.final GetAttr
Returns a GetAttr function containing the given path string.final GetAttr
getAttr
(Identifier path) Returns a GetAttr function containing the given identifier.final IsSet
isSet()
Returns an IsSet expression for this instance.final IsValidHostLabel
isValidHostLabel
(boolean allowDots) Returns an isValidHostLabel expression of this expression.final Not
not()
Returns a Not expression of this instance.final ParseUrl
parseUrl()
Returns a parseUrl expression of this expression.final StringEquals
stringEqual
(String value) Returns a StringEquals function of this expression and the given string value.final Substring
substring
(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, wait
Methods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition, toCondition, toConditionBuilder
Methods 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
BooleanEquals
function.
-
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
StringEquals
function.
-
getAttr
Returns a GetAttr function containing the given path string.- Parameters:
path
- the path.- Returns:
- the
GetAttr
function.
-
getAttr
Returns a GetAttr function containing the given identifier.- Parameters:
path
- the path.- Returns:
- the
GetAttr
function.
-
isSet
Returns an IsSet expression for this instance.- Returns:
- the
IsSet
function.
-
isValidHostLabel
Returns an isValidHostLabel expression of this expression.- Parameters:
allowDots
- whether the UTF-8.
is considered valid within a host label.- Returns:
- the
IsValidHostLabel
function.
-
not
Returns a Not expression of this instance.- Returns:
- the
Not
function.
-
parseUrl
Returns a parseUrl expression of this expression.- Returns:
- the
ParseUrl
function.
-
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
Substring
function.
-
template
Converts this expression to a string template. By default, this implementation returns aRuntimeException
.- Returns:
- the String template.
-