Class SyntaxElement
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
-
- All Implemented Interfaces:
ToCondition
,ToExpression
- Direct Known Subclasses:
Condition
,Expression
,Parameter
public abstract class SyntaxElement extends java.lang.Object implements ToCondition, ToExpression
A class that is coercible intoCondition
s andExpression
s for use in composing rule-sets in code.
-
-
Constructor Summary
Constructors Constructor Description SyntaxElement()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanEquals
booleanEqual(boolean value)
Returns a BooleanEquals expression comparing this expression to the provided boolean value.GetAttr
getAttr(java.lang.String path)
Returns a GetAttr function containing the given path string.GetAttr
getAttr(Identifier path)
Returns a GetAttr function containing the given identifier.IsSet
isSet()
Returns an IsSet expression for this instance.IsValidHostLabel
isValidHostLabel(boolean allowDots)
Returns an isValidHostLabel expression of this expression.Not
not()
Returns a Not expression of this instance.ParseUrl
parseUrl()
Returns a parseUrl expression of this expression.StringEquals
stringEqual(java.lang.String value)
Returns a StringEquals function of this expression and the given string value.Substring
substring(int startIndex, int stopIndex, boolean reverse)
Returns a Substring expression of this expression.java.lang.String
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
-
-
-
-
Method Detail
-
booleanEqual
public final BooleanEquals booleanEqual(boolean value)
Returns a BooleanEquals expression comparing this expression to the provided boolean value.- Parameters:
value
- the value to compare against.- Returns:
- the
BooleanEquals
function.
-
stringEqual
public final StringEquals stringEqual(java.lang.String value)
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
public final GetAttr getAttr(java.lang.String path)
Returns a GetAttr function containing the given path string.- Parameters:
path
- the path.- Returns:
- the
GetAttr
function.
-
getAttr
public final GetAttr getAttr(Identifier path)
Returns a GetAttr function containing the given identifier.- Parameters:
path
- the path.- Returns:
- the
GetAttr
function.
-
isSet
public final IsSet isSet()
Returns an IsSet expression for this instance.- Returns:
- the
IsSet
function.
-
isValidHostLabel
public final IsValidHostLabel isValidHostLabel(boolean allowDots)
Returns an isValidHostLabel expression of this expression.- Parameters:
allowDots
- whether the UTF-8.
is considered valid within a host label.- Returns:
- the
IsValidHostLabel
function.
-
parseUrl
public final ParseUrl parseUrl()
Returns a parseUrl expression of this expression.- Returns:
- the
ParseUrl
function.
-
substring
public final Substring substring(int startIndex, int stopIndex, boolean reverse)
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
public java.lang.String template()
Converts this expression to a string template. By default, this implementation returns aRuntimeException
.- Returns:
- the String template.
-
-