public final class FunctionDeclarationMaker extends Object
FunctionDeclaration| Constructor and Description |
|---|
FunctionDeclarationMaker() |
| Modifier and Type | Method and Description |
|---|---|
static FunctionDeclaration |
fromFunc(String functionDescription,
Method function,
String... orderedParameterNames)
Creates a FunctionDeclaration from a Java static method
Note:: If you don't want to manually provide parameter names, you can ignore
`orderedParameterNames` and compile your code with the "-parameters" flag.
|
static FunctionDeclaration |
fromJsonObject(com.google.gson.JsonObject jsonObject)
Creates a FunctionDeclaration from a JsonObject
|
static FunctionDeclaration |
fromJsonString(String jsonString)
Creates a FunctionDeclaration from a JsonString
|
public static FunctionDeclaration fromJsonString(String jsonString) throws com.google.protobuf.InvalidProtocolBufferException
jsonString - A valid Json String that can be parsed to a FunctionDeclaration.FunctionDeclaration by parsing the input json String.com.google.protobuf.InvalidProtocolBufferException - if the String can't be parsed into a FunctionDeclaration
proto.public static FunctionDeclaration fromJsonObject(com.google.gson.JsonObject jsonObject) throws com.google.protobuf.InvalidProtocolBufferException
jsonObject - A valid Json Object that can be parsed to a FunctionDeclaration.FunctionDeclaration by parsing the input json Object.com.google.protobuf.InvalidProtocolBufferException - if the jsonObject can't be parsed into a
FunctionDeclaration proto.public static FunctionDeclaration fromFunc(String functionDescription, Method function, String... orderedParameterNames)
Note:: If you don't want to manually provide parameter names, you can ignore `orderedParameterNames` and compile your code with the "-parameters" flag. In this case, the parameter names can be auto retrieved from reflection.
functionDescription - A description of the method.function - A Java static method.orderedParameterNames - A list of parameter names in the order they are passed to the
method.FunctionDeclaration instance.IllegalArgumentException - if the method is not a static method or the number of provided
parameter names doesn't match the number of parameters in the callable function or
parameter types in this method are not String, boolean, int, double, or float.IllegalStateException - if the parameter names are not provided and cannot be retrieved
from reflectionCopyright © 2025 Google LLC. All rights reserved.