Class Substring
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.functions.Substring
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,TypeCheck
,ToCondition
,ToExpression
public final class Substring extends LibraryFunction
A rule-set function for getting the substring of a string value.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Substring.Definition
AFunctionDefinition
for theSubstring
function.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ID
-
Fields inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
definition, functionNode
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
accept(ExpressionVisitor<T> visitor)
Invoke theExpressionVisitor
functions for this expression.static Substring.Definition
getDefinition()
Gets theFunctionDefinition
implementation.static Substring
ofExpressions(ToExpression expression, int startIndex, int stopIndex, boolean reverse)
Creates aSubstring
function from the given expressions.static Substring
ofExpressions(ToExpression expression, ToExpression startIndex, ToExpression stopIndex, ToExpression reverse)
Creates aSubstring
function from the given expressions.-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
equals, expectOneArgument, getArguments, getName, getSourceLocation, hashCode, toNode, toString, typeCheckLocal
-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
fromNode, getLiteral, getReference, of, of, of, parseShortform, toConditionBuilder, toExpression, type, typeCheck
-
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, toCondition
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDefinition
public static Substring.Definition getDefinition()
Gets theFunctionDefinition
implementation.- Returns:
- the function definition.
-
ofExpressions
public static Substring ofExpressions(ToExpression expression, ToExpression startIndex, ToExpression stopIndex, ToExpression reverse)
Creates aSubstring
function from the given expressions.- Parameters:
expression
- the string to extract from.startIndex
- the starting index.stopIndex
- the ending index.reverse
- the reverse order argument.- Returns:
- The resulting
Substring
function.
-
ofExpressions
public static Substring ofExpressions(ToExpression expression, int startIndex, int stopIndex, boolean reverse)
Creates aSubstring
function from the given expressions.- Parameters:
expression
- the string to extract from.startIndex
- the starting index.stopIndex
- the ending index.reverse
- the reverse order argument.- Returns:
- The resulting
Substring
function.
-
accept
public <T> T accept(ExpressionVisitor<T> visitor)
Description copied from class:Expression
Invoke theExpressionVisitor
functions for this expression.- Specified by:
accept
in classExpression
- Type Parameters:
T
- the visitor return type.- Parameters:
visitor
- the visitor to be invoked.- Returns:
- the return value of the visitor.
-
-