Top Description Inners Fields Constructors Methods
org.graalvm.options

public final Class OptionDescriptor

extends Object
Class Inheritance
Imports
java.util.Objects

Represents metadata for a single option.
Since
19.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
OptionDescriptor.Builder

Represents an option descriptor builder.

Field Summary

Modifier and TypeField and Description
private final OptionCategory
private final boolean
private final String
private static final OptionDescriptor
private final String
private final OptionKey<?>
private final String
private final OptionStability
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
OptionDescriptor(OptionKey<?> key, String name, String help, OptionCategory category, OptionStability stability, boolean deprecated, String deprecationMessage, String usageSyntax)

Method Summary

Modifier and TypeMethod and Description
private static String
enumUsageSyntax(Object defaultValue, Class<?> aClass)

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public OptionCategory
getCategory()

Returns the user category of this option.

public String
getDeprecationMessage()

Returns the deprecation reason and the recommended fix.

public String
getHelp()

Returns a human-readable description on how to use the option.

public OptionKey<?>
getKey()

Returns the key for this option.

public String
getName()

Returns the name of the option that this descriptor represents.

public OptionStability
getStability()

Returns the stability of this option.

public String

Returns:

null if no usage syntax should be used, the usage syntax otherwise
getUsageSyntax
()

Specifies a human-readable syntax describing the accepted values for this option.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean
isDeprecated()

Returns true if this option was marked deprecated.

public boolean
isOptionMap()

Returns true if this option is an option map.

public static <T> OptionDescriptor.Builder
newBuilder(OptionKey<T> key, String name)

Creates a new option descriptor builder by key.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

categoryback to summary
private final OptionCategory category
deprecatedback to summary
private final boolean deprecated
deprecationMessageback to summary
private final String deprecationMessage
EMPTYback to summary
private static final OptionDescriptor EMPTY
helpback to summary
private final String help
keyback to summary
private final OptionKey<?> key
nameback to summary
private final String name
stabilityback to summary
private final OptionStability stability
usageSyntaxback to summary
private final String usageSyntax

Constructor Detail

OptionDescriptorback to summary
pack-priv OptionDescriptor(OptionKey<?> key, String name, String help, OptionCategory category, OptionStability stability, boolean deprecated, String deprecationMessage, String usageSyntax)

Method Detail

enumUsageSyntaxback to summary
private static String enumUsageSyntax(Object defaultValue, Class<?> aClass)
Annotations
@SuppressWarnings:unchecked, rawtypes
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
Since
19.0
getCategoryback to summary
public OptionCategory getCategory()

Returns the user category of this option.

Since
19.0
getDeprecationMessageback to summary
public String getDeprecationMessage()

Returns the deprecation reason and the recommended fix. For newlines, use %n.

Since
20.1.0
getHelpback to summary
public String getHelp()

Returns a human-readable description on how to use the option. For newlines, use %n.

Since
19.0
getKeyback to summary
public OptionKey<?> getKey()

Returns the key for this option.

Since
19.0
getNameback to summary
public String getName()

Returns the name of the option that this descriptor represents.

Since
19.0
getStabilityback to summary
public OptionStability getStability()

Returns the stability of this option.

Since
19.0
getUsageSyntaxback to summary
public String getUsageSyntax()

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

Since
22.1
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
Since
19.0
isDeprecatedback to summary
public boolean isDeprecated()

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.

Since
19.0
isOptionMapback to summary
public boolean isOptionMap()

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.

Since
19.2
newBuilderback to summary
public static <T> OptionDescriptor.Builder newBuilder(OptionKey<T> key, String name)

Creates a new option descriptor builder by key. The option group and name is inferred by the key.

Since
19.0
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
Since
19.0
org.graalvm.options back to summary

public final Class OptionDescriptor.Builder

extends Object
Class Inheritance

Represents an option descriptor builder.
Since
19.0

Field Summary

Modifier and TypeField and Description
private OptionCategory
private boolean
private String
private String
private final OptionKey<?>
private final String
private OptionStability
private String

Constructor Summary

AccessConstructor and Description
pack-priv
Builder(OptionKey<?> key, String name)

Method Summary

Modifier and TypeMethod and Description
public OptionDescriptor
build()

Builds and returns a new option descriptor.

public OptionDescriptor.Builder
category(OptionCategory category)

Defines the user category for this option.

public OptionDescriptor.Builder
deprecated(boolean deprecated)

Defines if this option is deprecated.

public OptionDescriptor.Builder
deprecationMessage(String deprecationMessage)

Specifies a human-readable deprecation reason and the recommended fix.

public OptionDescriptor.Builder
help(String help)

Specifies a human-readable description on how to use the option.

public OptionDescriptor.Builder
stability(OptionStability stability)

Defines the stability of this option.

public OptionDescriptor.Builder
usageSyntax(String usageSyntax)

Specifies a human-readable syntax describing the accepted values for this option.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

categoryback to summary
private OptionCategory category
deprecatedback to summary
private boolean deprecated
deprecationMessageback to summary
private String deprecationMessage
helpback to summary
private String help
keyback to summary
private final OptionKey<?> key
nameback to summary
private final String name
stabilityback to summary
private OptionStability stability
usageSyntaxback to summary
private String usageSyntax

Constructor Detail

Builderback to summary
pack-priv Builder(OptionKey<?> key, String name)

Method Detail

buildback to summary
public OptionDescriptor build()

Builds and returns a new option descriptor.

Since
19.0
categoryback to summary
public OptionDescriptor.Builder category(OptionCategory category)

Defines the user category for this option. The default value is OptionCategory#INTERNAL.

Since
19.0
deprecatedback to summary
public OptionDescriptor.Builder deprecated(boolean deprecated)

Defines if this option is deprecated. The default value for deprecated is false. This can be used to evolve options between releases.

Since
19.0
deprecationMessageback to summary
public OptionDescriptor.Builder deprecationMessage(String deprecationMessage)

Specifies a human-readable deprecation reason and the recommended fix.

Since
20.1.0
helpback to summary
public OptionDescriptor.Builder help(String help)

Specifies a human-readable description on how to use the option.

Since
19.0
stabilityback to summary
public OptionDescriptor.Builder stability(OptionStability stability)

Defines the stability of this option. The default value is OptionStability#EXPERIMENTAL.

Since
19.0
usageSyntaxback to summary
public OptionDescriptor.Builder usageSyntax(String usageSyntax)

Specifies a human-readable syntax describing the accepted values for this option.

Since
22.1