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 intoConditions andExpressions 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 BooleanEqualsbooleanEqual(boolean value)Returns a BooleanEquals expression comparing this expression to the provided boolean value.GetAttrgetAttr(java.lang.String path)Returns a GetAttr function containing the given path string.GetAttrgetAttr(Identifier path)Returns a GetAttr function containing the given identifier.IsSetisSet()Returns an IsSet expression for this instance.IsValidHostLabelisValidHostLabel(boolean allowDots)Returns an isValidHostLabel expression of this expression.Notnot()Returns a Not expression of this instance.ParseUrlparseUrl()Returns a parseUrl expression of this expression.StringEqualsstringEqual(java.lang.String value)Returns a StringEquals function of this expression and the given string value.Substringsubstring(int startIndex, int stopIndex, boolean reverse)Returns a Substring expression of this expression.java.lang.Stringtemplate()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
BooleanEqualsfunction.
-
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
StringEqualsfunction.
-
getAttr
public final GetAttr getAttr(java.lang.String path)
Returns a GetAttr function containing the given path string.- Parameters:
path- the path.- Returns:
- the
GetAttrfunction.
-
getAttr
public final GetAttr getAttr(Identifier path)
Returns a GetAttr function containing the given identifier.- Parameters:
path- the path.- Returns:
- the
GetAttrfunction.
-
isSet
public final IsSet isSet()
Returns an IsSet expression for this instance.- Returns:
- the
IsSetfunction.
-
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
IsValidHostLabelfunction.
-
parseUrl
public final ParseUrl parseUrl()
Returns a parseUrl expression of this expression.- Returns:
- the
ParseUrlfunction.
-
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
Substringfunction.
-
template
public java.lang.String template()
Converts this expression to a string template. By default, this implementation returns aRuntimeException.- Returns:
- the String template.
-
-