---
title: "OptionDescriptor.Builder"
description: "Represents an option descriptor builder."
kind: "class"
id: "org.graalvm.options.OptionDescriptor$Builder"
module: "polyglot"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/options/OptionDescriptor.Builder.html"
---

# ◆ OptionDescriptor.Builder

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

Class in [`org.graalvm.options`](index.md). Since 19.0. Nested in [`OptionDescriptor`](OptionDescriptor.md).

```java
public final class OptionDescriptor.Builder
```

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

Represents an option descriptor builder.

## Methods

### category(OptionCategory)
<a id="category(org.graalvm.options.OptionCategory)"></a>`public OptionDescriptor.Builder category(OptionCategory category)`. Since 19.0. Defines the user category for this option. The default value is `OptionCategory.INTERNAL`. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#category(org.graalvm.options.OptionCategory)`

### stability(OptionStability)
<a id="stability(org.graalvm.options.OptionStability)"></a>`public OptionDescriptor.Builder stability(OptionStability stability)`. Since 19.0. Defines the stability of this option. The default value is `OptionStability.EXPERIMENTAL`. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#stability(org.graalvm.options.OptionStability)`

### deprecated(boolean)
<a id="deprecated(boolean)"></a>`public OptionDescriptor.Builder deprecated(boolean deprecated)`. Since 19.0. Defines if this option is deprecated. The default value for deprecated is `false`. This can be used to evolve options between releases. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#deprecated(boolean)`

### help(String)
<a id="help(java.lang.String)"></a>`public OptionDescriptor.Builder help(String help)`. Since 19.0. Specifies a human-readable description on how to use the option. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#help(java.lang.String)`

### usageSyntax(String)
<a id="usageSyntax(java.lang.String)"></a>`public OptionDescriptor.Builder usageSyntax(String usageSyntax)`. Since 22.1. Specifies a human-readable syntax describing the accepted values for this option. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#usageSyntax(java.lang.String)`

### deprecationMessage(String)
<a id="deprecationMessage(java.lang.String)"></a>`public OptionDescriptor.Builder deprecationMessage(String deprecationMessage)`. Since 20.1.0. Specifies a human-readable deprecation reason and the recommended fix. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#deprecationMessage(java.lang.String)`

### constant(boolean)
<a id="constant(boolean)"></a>`public OptionDescriptor.Builder constant(boolean value)`. Since 25.1. Marks this option as constant. Constant options use `ConstantOptionKey` as their key type and must be configured using the system property `-Dpolyglot.<option-name>=<value>` before the polyglot runtime is initialized. Setting a constant option at runtime via `org.graalvm.polyglot.Engine.Builder.option(String, String)` throws an [`IllegalArgumentException`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/IllegalArgumentException.html). The default value is `false`. See also: `ConstantOptionKey`. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#constant(boolean)`

### build()
<a id="build()"></a>`public OptionDescriptor build()`. Since 19.0. Builds and returns a new option descriptor. Throws: `IllegalArgumentException` (unchecked): if this descriptor is marked with `constant(true)` but the key is not a `ConstantOptionKey`, or if the key is a `ConstantOptionKey` but the descriptor is not marked with `constant(true)`. Cite: `org/graalvm/options/OptionDescriptor.Builder.html#build()`

## Inherited members

- From class [`Object`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html): [`clone`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#clone%28%29), [`equals`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#equals%28java.lang.Object%29), [`finalize`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#finalize%28%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), [`toString`](https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/lang/Object.html#toString%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)
