Snippet.Kind (Java SE 19 & JDK 19) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io"), [Comparable](../../../java.base/java/lang/Comparable.html "interface in java.lang")<[Snippet.Kind](Snippet.Kind.html "enum class in jdk.jshell")>, [Constable](../../../java.base/java/lang/constant/Constable.html "interface in java.lang.constant")

Enclosing class:

[Snippet](Snippet.html "class in jdk.jshell")


Describes the general kind of snippet. The Kind is an immutable property of a Snippet. It is accessed with Snippet.kind(). The Kind can be used to determine which subclass of Snippet it is. For example,eval("int three() { return 3; }") will return a snippet creation event. The Kind of that Snippet will be METHOD, from which you know that the subclass of Snippet is MethodSnippet and it can be cast as such.

Enum Constants
A syntactically incorrect input for which the specific kind could not be determined.
An expression, with or without side-effects.
An import declaration: import ...
One variable declaration.

boolean
Indicates whether this Kind of Snippet is persistent.
Returns the enum constant of this class with the specified name.
[values](#values%28%29)()
Returns an array containing the constants of this enum class, in the order they are declared.

Methods declared in class java.lang.Enum

[clone](../../../java.base/java/lang/Enum.html#clone%28%29), [compareTo](../../../java.base/java/lang/Enum.html#compareTo%28E%29), [describeConstable](../../../java.base/java/lang/Enum.html#describeConstable%28%29), [equals](../../../java.base/java/lang/Enum.html#equals%28java.lang.Object%29), [finalize](../../../java.base/java/lang/Enum.html#finalize%28%29), [getDeclaringClass](../../../java.base/java/lang/Enum.html#getDeclaringClass%28%29), [hashCode](../../../java.base/java/lang/Enum.html#hashCode%28%29), [name](../../../java.base/java/lang/Enum.html#name%28%29), [ordinal](../../../java.base/java/lang/Enum.html#ordinal%28%29), [toString](../../../java.base/java/lang/Enum.html#toString%28%29), [valueOf](../../../java.base/java/lang/Enum.html#valueOf%28java.lang.Class,java.lang.String%29)