Package net.bytebuddy.utility
Enum GraalImageCode
- java.lang.Object
-
- java.lang.Enum<GraalImageCode>
-
- net.bytebuddy.utility.GraalImageCode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GraalImageCode>
public enum GraalImageCode extends java.lang.Enum<GraalImageCode>
A utility that resolves Graal VM native image properties.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AGENT
Indicates that a Graal VM assisted configuration agent is running.BUILD
Indicates that a Graal VM native image build is executed.NONE
Indicates that no Graal VM property is set.RUNTIME
Indicates that a Graal VM native image is being executed.UNKNOWN
Indicates that a Graal VM property is set to an unknown value.
-
Field Summary
Fields Modifier and Type Field Description private static GraalImageCode
current
The current image code.private boolean
defined
true
if this image code indicates that a valid Graal related property is set.private boolean
nativeImageExecution
true
if this image code indicates that a Graal native image build is executed.
-
Constructor Summary
Constructors Modifier Constructor Description private
GraalImageCode(boolean defined, boolean nativeImageExecution)
Creates a new Graal image code.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static <T> T
doPrivileged(java.security.PrivilegedAction<T> action)
A proxy forjava.security.AccessController#doPrivileged
that is activated if available.static GraalImageCode
getCurrent()
Resolves the status of the Graal image code.boolean
isDefined()
Returnstrue
if this image code indicates that a valid Graal related property is set.boolean
isNativeImageExecution()
Returnstrue
if this image code indicates that a Graal native image build is executed.static GraalImageCode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static GraalImageCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AGENT
public static final GraalImageCode AGENT
Indicates that a Graal VM assisted configuration agent is running.
-
BUILD
public static final GraalImageCode BUILD
Indicates that a Graal VM native image build is executed.
-
RUNTIME
public static final GraalImageCode RUNTIME
Indicates that a Graal VM native image is being executed.
-
UNKNOWN
public static final GraalImageCode UNKNOWN
Indicates that a Graal VM property is set to an unknown value.
-
NONE
public static final GraalImageCode NONE
Indicates that no Graal VM property is set.
-
-
Field Detail
-
current
private static GraalImageCode current
The current image code.
-
defined
private final boolean defined
true
if this image code indicates that a valid Graal related property is set.
-
nativeImageExecution
private final boolean nativeImageExecution
true
if this image code indicates that a Graal native image build is executed.
-
-
Constructor Detail
-
GraalImageCode
private GraalImageCode(boolean defined, boolean nativeImageExecution)
Creates a new Graal image code.- Parameters:
defined
-true
if this image code indicates that a valid Graal related property is set.nativeImageExecution
-true
if this image code indicates that a Graal native image build is executed.
-
-
Method Detail
-
values
public static GraalImageCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GraalImageCode c : GraalImageCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GraalImageCode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getCurrent
public static GraalImageCode getCurrent()
Resolves the status of the Graal image code.- Returns:
- The status of the Graal image code.
-
doPrivileged
@Enhance private static <T> T doPrivileged(java.security.PrivilegedAction<T> action)
A proxy forjava.security.AccessController#doPrivileged
that is activated if available.- Type Parameters:
T
- The type of the action's resolved value.- Parameters:
action
- The action to execute from a privileged context.- Returns:
- The action's resolved value.
-
isDefined
public boolean isDefined()
Returnstrue
if this image code indicates that a valid Graal related property is set.- Returns:
true
if this image code indicates that a valid Graal related property is set.
-
isNativeImageExecution
public boolean isNativeImageExecution()
Returnstrue
if this image code indicates that a Graal native image build is executed.- Returns:
true
if this image code indicates that a Graal native image build is executed.
-
-