---
title: "OptionDescriptor"
description: "Represents metadata for a single option."
kind: "class"
id: "org.graalvm.options.OptionDescriptor"
module: "polyglot"
version: "25.6.0-elide.4"
canonical: "https://graalvm.elide.help/25.6.0-elide.4/api/polyglot/org/graalvm/options/OptionDescriptor.html"
---

# ◆ OptionDescriptor

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

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

```java
public final class OptionDescriptor
```

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

Represents metadata for a single option.

## Nested types

- [`OptionDescriptor.Builder`](OptionDescriptor.Builder.md) (class): Represents an option descriptor builder.

## Methods

### getName()
<a id="getName()"></a>`public String getName()`. Since 19.0. Returns the name of the option that this descriptor represents. Cite: `org/graalvm/options/OptionDescriptor.html#getName()`

### getKey()
<a id="getKey()"></a>`public OptionKey<?> getKey()`. Since 19.0. Returns the key for this option. Cite: `org/graalvm/options/OptionDescriptor.html#getKey()`

### isDeprecated()
<a id="isDeprecated()"></a>`public boolean isDeprecated()`. Since 19.0. Returns `true` if this option was marked deprecated. This indicates that the option is going to be removed in a future release or its use is not recommended. Cite: `org/graalvm/options/OptionDescriptor.html#isDeprecated()`

### getDeprecationMessage()
<a id="getDeprecationMessage()"></a>`public String getDeprecationMessage()`. Since 20.1.0. Returns the deprecation reason and the recommended fix. For newlines, use `%n`. Cite: `org/graalvm/options/OptionDescriptor.html#getDeprecationMessage()`

### isOptionMap()
<a id="isOptionMap()"></a>`public boolean isOptionMap()`. Since 19.2. Returns `true` if this option is an option map. Options maps allow to collect key=value pairs whose keys are unknown beforehand e.g. user defined properties. Cite: `org/graalvm/options/OptionDescriptor.html#isOptionMap()`

### getCategory()
<a id="getCategory()"></a>`public OptionCategory getCategory()`. Since 19.0. Returns the user category of this option. Cite: `org/graalvm/options/OptionDescriptor.html#getCategory()`

### getStability()
<a id="getStability()"></a>`public OptionStability getStability()`. Since 19.0. Returns the stability of this option. Cite: `org/graalvm/options/OptionDescriptor.html#getStability()`

### getHelp()
<a id="getHelp()"></a>`public String getHelp()`. Since 19.0. Returns a human-readable description on how to use the option. For newlines, use `%n`. Cite: `org/graalvm/options/OptionDescriptor.html#getHelp()`

### getUsageSyntax()
<a id="getUsageSyntax()"></a>`public String getUsageSyntax()`. Since 22.1. Specifies a human-readable syntax describing the accepted values for this option. Returns `String`: null if no usage syntax should be used, the usage syntax otherwise. Cite: `org/graalvm/options/OptionDescriptor.html#getUsageSyntax()`

### isConstant()
<a id="isConstant()"></a>`public boolean isConstant()`. Since 25.1. Returns `true` if this option is constant. Constant options value is static and final before the polyglot runtime is initialized and cannot be changed at runtime. The value is read from the system property `-Dpolyglot.<option-name>=<value>` during class initialization. If absent, the `default value` is used. Once set, calls to `org.graalvm.options.ConstantOptionKey.getConstantValue()` on a `static final` field are eligible for constant folding by the GraalVM compiler, allowing dead branches to be eliminated. See also: `ConstantOptionKey`. Cite: `org/graalvm/options/OptionDescriptor.html#isConstant()`

### toString()
<a id="toString()"></a>`public String toString()`. Since 19.0. Overrides `toString()`. Cite: `org/graalvm/options/OptionDescriptor.html#toString()`

### hashCode()
<a id="hashCode()"></a>`public int hashCode()`. Since 19.0. Overrides `hashCode()`. Cite: `org/graalvm/options/OptionDescriptor.html#hashCode()`

### equals(Object)
<a id="equals(java.lang.Object)"></a>`public boolean equals(Object obj)`. Since 19.0. Overrides `equals(java.lang.Object)`. Cite: `org/graalvm/options/OptionDescriptor.html#equals(java.lang.Object)`

### newBuilder(OptionKey, String)
<a id="newBuilder(org.graalvm.options.OptionKey,java.lang.String)"></a>`public static <T> OptionDescriptor.Builder newBuilder(OptionKey<T> key, String name)`. Since 19.0. Creates a new option descriptor builder by key. The option group and name is inferred by the key. Cite: `org/graalvm/options/OptionDescriptor.html#newBuilder(org.graalvm.options.OptionKey,java.lang.String)`

## 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), [`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), [`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)
