Enum Class JavaFeature
- All Implemented Interfaces:
Serializable
,Comparable<JavaFeature>
,java.lang.constant.Constable
An internal enumeration of all Java language features that were introduced as
standard feature or preview feature from Java 15. The idea is to have one
location where the applicability of a feature, such as version supported in,
whether or not a preview, what are the restricted keywords introduced by a
feature etc. This is expected to be updated every time there's a new Java
version and the change is expected to be one of the following kinds:
- The preview feature continues to be a preview in the next version
- The preview feature is upgraded to a standard feature
- The preview feature is removed
- Author:
- jay
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionlong
getName()
char[][]
boolean
boolean
isSupported(long comp, boolean preview)
boolean
isSupported(CompilerOptions options)
static JavaFeature
Returns the enum constant of this class with the specified name.static JavaFeature[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SWITCH_EXPRESSIONS
-
TEXT_BLOCKS
-
PATTERN_MATCHING_IN_INSTANCEOF
-
RECORDS
-
SEALED_CLASSES
-
PATTERN_MATCHING_IN_SWITCH
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isPreview
public boolean isPreview() -
getName
-
getCompliance
public long getCompliance() -
getRestrictedKeywords
public char[][] getRestrictedKeywords() -
isSupported
-
isSupported
public boolean isSupported(long comp, boolean preview)
-