Class FunctionNode
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.fn.FunctionNode
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToSmithyBuilder<FunctionNode>
public final class FunctionNode
extends Object
implements FromSourceLocation, ToNode, ToSmithyBuilder<FunctionNode>
Parsed but not validated function contents containing the `fn` name and `argv`.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic FunctionNode.Builderbuilder()Returns a new builder instance.booleanstatic FunctionNodefromNode(ObjectNode function) Constructs aFunctionNodefrom the providedObjectNode.getName()Gets the source location of a value.inthashCode()static FunctionNodeofExpressions(String functionName, Expression... arguments) Constructs aFunctionNodefor the given function name and arguments.Returns a new builder instance for thisFunctionNode.toNode()Converts a value to aNode.validate()Returns an expression representing this function.
-
Method Details
-
ofExpressions
Constructs aFunctionNodefor the given function name and arguments.- Parameters:
functionName- the function name.arguments- zero or more expressions as arguments to the function.- Returns:
- the
FunctionNode.
-
fromNode
Constructs aFunctionNodefrom the providedObjectNode.- Parameters:
function- the node describing the function.- Returns:
- the
FunctionNode.
-
builder
Returns a new builder instance.- Returns:
- the new builder instance.
-
toBuilder
Returns a new builder instance for thisFunctionNode.- Specified by:
toBuilderin interfaceToSmithyBuilder<FunctionNode>- Returns:
- the new builder instance.
-
validate
Returns an expression representing this function.- Returns:
- this function as an expression.
-
getName
-
getArguments
-
getSourceLocation
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
hashCode
public int hashCode() -
equals
-