---
title: "InlineSnippet"
description: "The unit of execution with an inline source."
kind: "class"
id: "org.graalvm.polyglot.tck.InlineSnippet"
module: "polyglot-tck"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/polyglot-tck/org/graalvm/polyglot/tck/InlineSnippet.html"
---

# ◆ InlineSnippet

[polyglot-tck](../../../../index.md) › [org.graalvm.polyglot.tck](index.md) · Every page: [llms.txt](../../../../llms.txt)

Class in [`org.graalvm.polyglot.tck`](index.md). Since 0.32.

```java
public final class InlineSnippet
```

Inheritance: [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html) > `InlineSnippet`

The unit of execution with an inline source. The [`InlineSnippet`](InlineSnippet.md) represents an execution of a script and an associated inline source code that is to be executed at script's locations.

It's recommended to provide two snippets at least, one with local variables and restricted [`location predicate`](InlineSnippet.Builder.md#locationPredicate%28java.util.function.Predicate%29) and one with globally accessible [`code`](InlineSnippet.md#getCode%28%29) and no location predicate.

## Nested types

- [`InlineSnippet.Builder`](InlineSnippet.Builder.md) (class): The builder of an InlineSnippet.

## Methods

### getScript()
<a id="getScript()"></a>`public Snippet getScript()`. Since 0.32. Returns a script to be executed. The `source code` is executed inlined in this script. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#getScript()`

### getCode()
<a id="getCode()"></a>`public CharSequence getCode()`. Since 0.32. Returns an inline source code that is to be executed at specific `locations`, or at all statement and call locations if the predicate is `null`. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#getCode()`

### getLocationPredicate()
<a id="getLocationPredicate()"></a>`public Predicate<SourceSection> getLocationPredicate()`. Since 0.32. Returns a testing predicate for locations at which `source code` is executed. Returns `Predicate<SourceSection>`: the predicate that returns `true` for [`SourceSection`](https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/polyglot/SourceSection.html)s where the `source code` is to be executed, or `null` if the source code should be executed at all instrumentable statement and call locations. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#getLocationPredicate()`

### getResultVerifier()
<a id="getResultVerifier()"></a>`public ResultVerifier getResultVerifier()`. Since 0.32. Returns the `ResultVerifier` to verify the result of `source code` execution. Returns `ResultVerifier`: either a custom or the default `ResultVerifier`. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#getResultVerifier()`

### toString()
<a id="toString()"></a>`public String toString()`. Since 0.32. Overrides `toString()`. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#toString()`

### newBuilder(Snippet, CharSequence)
<a id="newBuilder(org.graalvm.polyglot.tck.Snippet,java.lang.CharSequence)"></a>`public static InlineSnippet.Builder newBuilder(Snippet script, CharSequence code)`. Since 0.32. Creates a new `InlineSnippet` builder object. Parameters: `script` `Snippet`: the script to execute (use `Snippet.newBuilder(String, Value, TypeDescriptor)` to create one). `code` `CharSequence`: the inline source code that is to be executed inside the script. Returns `InlineSnippet.Builder`: the new `Builder`. Cite: `org/graalvm/polyglot/tck/InlineSnippet.html#newBuilder(org.graalvm.polyglot.tck.Snippet,java.lang.CharSequence)`

## Inherited members

- From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`getClass`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#getClass%28%29), [`hashCode`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#hashCode%28%29), [`notify`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notify%28%29), [`notifyAll`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#notifyAll%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long%29), [`wait`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#wait%28long,int%29)
