Modifier and Type | Class and Description |
---|---|
static class |
Snippet.Builder
The builder of a
Snippet . |
Modifier and Type | Method and Description |
---|---|
Value |
getExecutableValue()
Returns the function executing the
Snippet . |
String |
getId()
Returns the identifier of a snippet.
|
List<? extends TypeDescriptor> |
getParameterTypes()
Returns the types of
Snippet formal parameters. |
ResultVerifier |
getResultVerifier()
Returns the
ResultVerifier to verify the execution result. |
TypeDescriptor |
getReturnType()
Returns the
Snippet return type. |
static Snippet.Builder |
newBuilder(String id,
Value executableValue,
TypeDescriptor executableReturnType)
Creates a new
Snippet builder object. |
String |
toString() |
public String getId()
Snippet
s from a single
LanguageProvider
with the same identifier but different types are treated as
overloads.Snippet
identifierpublic Value getExecutableValue()
Snippet
.Value
public TypeDescriptor getReturnType()
Snippet
return type.public List<? extends TypeDescriptor> getParameterTypes()
Snippet
formal parameters.public ResultVerifier getResultVerifier()
ResultVerifier
to verify the execution result.ResultVerifier
.ResultVerifier.accept(org.graalvm.polyglot.tck.ResultVerifier.SnippetRun).
public static Snippet.Builder newBuilder(String id, Value executableValue, TypeDescriptor executableReturnType)
Snippet
builder object.id
- the Snippet
identifier The Snippet
s from a single
LanguageProvider
with the same identifier but different types are treated
as overloads.executableValue
- the executable Value
used to execute the Snippet
executableReturnType
- the Snippet
return typeSnippet.Builder