Class Function
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.util.MandatorySourceLocation
-
- software.amazon.smithy.rulesengine.language.syntax.expr.Expression
-
- software.amazon.smithy.rulesengine.language.syntax.fn.Function
-
- All Implemented Interfaces:
FromSourceLocation,ToNode,Into<Condition>,TypeCheck
- Direct Known Subclasses:
BooleanEquals,IsSet,LibraryFunction,Not,StringEquals
public abstract class Function extends Expression implements Into<Condition>
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionNodefunctionNode
-
Constructor Summary
Constructors Constructor Description Function(FunctionNode functionNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Conditioncondition()Convert this function into a condition.Conditioncondition(java.lang.String result)Converts this function into a condition which stores the output in the named result.booleanequals(java.lang.Object obj)protected ExpressionexpectOneArgument()java.util.List<Expression>getArguments()java.lang.StringgetName()Returns the name of this function, eg.SourceLocationgetSourceLocation()Gets the source location of a value.inthashCode()Conditioninto()NodetoNode()Converts a value to aNode.java.lang.StringtoString()-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expr.Expression
accept, equal, equal, fromNode, getAttr, getAttr, isSet, isValidHostLabel, isVirtualHostableS3Bucket, literal, not, of, of, of, parseArn, parseShortform, parseUrl, reference, substring, template, type, typeCheck, typeCheckLocal
-
-
-
-
Field Detail
-
functionNode
protected final FunctionNode functionNode
-
-
Constructor Detail
-
Function
public Function(FunctionNode functionNode)
-
-
Method Detail
-
condition
public Condition condition()
Convert this function into a condition.- Returns:
- the function as a condition.
-
condition
public Condition condition(java.lang.String result)
Converts this function into a condition which stores the output in the named result.- Parameters:
result- the name of the result parameter.- Returns:
- the function as a condition.
-
getName
public java.lang.String getName()
Returns the name of this function, eg.isSet,parseUrl- Returns:
- The name
-
getArguments
public java.util.List<Expression> getArguments()
- Returns:
- The arguments to this function
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
expectOneArgument
protected Expression expectOneArgument()
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Overrides:
getSourceLocationin classMandatorySourceLocation- Returns:
- Returns the source location of the value.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCodein classExpression
-
-