Snippet
public final class Snippet- Inheritance
ObjectSnippet
Methods7
String getId()
Value getExecutableValue()
getExecutableValue
since 0.30public Value getExecutableValue()Returns the function executing the Snippet.
TypeDescriptor getReturnType()
getReturnType
since 0.30public TypeDescriptor getReturnType()Returns the Snippet return type.
Returns
TypeDescriptor- the return type
List<? extends TypeDescriptor> getParameterTypes()
getParameterTypes
since 0.30public List< ? extends TypeDescriptor> getParameterTypes()Returns the types of Snippet formal parameters.
Returns
List<? extends TypeDescriptor> - the parameter types
ResultVerifier getResultVerifier()
getResultVerifier
since 0.30public ResultVerifier getResultVerifier()Returns the ResultVerifier to verify the execution result.
Returns
ResultVerifier- either a custom or the default
ResultVerifier.
String toString()Described in toString().
static Snippet.Builder newBuilder(String, Value, TypeDescriptor)
newBuilder
staticsince 0.30public static Snippet.Builder newBuilder(
String id,
Value executableValue,
TypeDescriptor executableReturnType
)Creates a new Snippet builder object.
Parameters
idString- the
Snippetidentifier TheSnippets from a singleLanguageProviderwith the same identifier but different types are treated as overloads. executableReturnTypeTypeDescriptor- the
Snippetreturn type
Returns
Snippet.Builder- the new
Builder
Nested types
public static final class .BuilderThe builder of a
Snippet.