Snippet.Status (Java SE 15 & JDK 15) (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.Status](Snippet.Status.html "enum in jdk.jshell")>, [Constable](../../../java.base/java/lang/constant/Constable.html "interface in java.lang.constant")

Enclosing class:

Snippet


public static enum Snippet.Status extends Enum<Snippet.Status>

Describes the current state of a Snippet. This is a dynamic property of a Snippet within the JShell state -- thus is retrieved with a query on {@code JShell}.

The Status changes as the state changes. For example, creation of another snippet witheval may resolve dependencies of this Snippet (or invalidate those dependencies), oroverwrite this Snippet changing itsStatus.

Important properties associated with Status are:isDefined(), if it is visible to other existing and new snippets; andisActive(), if, as the JShell state changes, the snippet will update, possibly changing Status. An executable Snippet can only be executed if it is in the theVALID Status.

See Also:

JShell.status(jdk.jshell.Snippet)

Enum Constants

Enum Constant Description
DROPPED The snippet is inactive because of an explicit call to the JShell.drop(Snippet).
NONEXISTENT The snippet is inactive because it does not yet exist.
OVERWRITTEN The snippet is inactive because it has been replaced by a new snippet.
RECOVERABLE_DEFINED The snippet is a declaration snippet with potentially recoverable unresolved references or other issues in its body (in the context of current JShell state).
RECOVERABLE_NOT_DEFINED The snippet is a declaration snippet with potentially recoverable unresolved references or other issues (in the context of current JShell state).
REJECTED The snippet is inactive because it failed compilation on initial evaluation and it is not capable of becoming valid with further changes to the JShell state.
VALID The snippet is a valid snippet (in the context of current JShell state).
Modifier and Type Method Description
boolean isActive() Indicates whether the Snippet is active, that is, will a persistent snippet be re-evaluated when a newJShell.eval(String) orJShell.drop(Snippet) that could change its status is invoked.
boolean isDefined() Indicates whether the snippet is currently part of the defined state of the JShell.
static Snippet.Status valueOf​(String name) Returns the enum constant of this type with the specified name.
static Snippet.Status[] values() Returns an array containing the constants of this enum type, 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)