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
A rule-set function for getting the substring of a string value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAFunctionDefinitionfor theSubstringfunction. -
Field Summary
FieldsFields inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
definition, functionNode -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(ExpressionVisitor<T> visitor) Invoke theExpressionVisitorfunctions for this expression.static Substring.DefinitionGets theFunctionDefinitionimplementation.static SubstringofExpressions(ToExpression expression, int startIndex, int stopIndex, boolean reverse) Creates aSubstringfunction from the given expressions.static SubstringofExpressions(ToExpression expression, ToExpression startIndex, ToExpression stopIndex, ToExpression reverse) Creates aSubstringfunction 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, typeCheckLocalMethods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
fromNode, getLiteral, getReference, of, of, of, parseShortform, toConditionBuilder, toExpression, type, typeCheckMethods inherited from class software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substring, templateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition, toCondition
-
Field Details
-
ID
- See Also:
-
-
Method Details
-
getDefinition
Gets theFunctionDefinitionimplementation.- Returns:
- the function definition.
-
ofExpressions
public static Substring ofExpressions(ToExpression expression, ToExpression startIndex, ToExpression stopIndex, ToExpression reverse) Creates aSubstringfunction 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
Substringfunction.
-
ofExpressions
public static Substring ofExpressions(ToExpression expression, int startIndex, int stopIndex, boolean reverse) Creates aSubstringfunction 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
Substringfunction.
-
accept
Description copied from class:ExpressionInvoke theExpressionVisitorfunctions for this expression.- Specified by:
acceptin classExpression- Type Parameters:
T- the visitor return type.- Parameters:
visitor- the visitor to be invoked.- Returns:
- the return value of the visitor.
-