Package com.strobel.assembler.metadata
Enum LanguageFeature
- java.lang.Object
-
- java.lang.Enum<LanguageFeature>
-
- com.strobel.assembler.metadata.LanguageFeature
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LanguageFeature>
public enum LanguageFeature extends java.lang.Enum<LanguageFeature>
-
-
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description private CompilerTarget
_previewVersion
private CompilerTarget
_version
-
Constructor Summary
Constructors Modifier Constructor Description private
LanguageFeature(CompilerTarget version)
private
LanguageFeature(CompilerTarget version, CompilerTarget previewVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isAvailable(CompilerTarget targetVersion)
boolean
isAvailable(CompilerTarget targetVersion, boolean allowPreview)
boolean
isAvailable(TypeDefinition definition)
boolean
isAvailable(TypeDefinition definition, boolean allowPreview)
CompilerTarget
previewVersion()
static LanguageFeature
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LanguageFeature[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.CompilerTarget
version()
-
-
-
Enum Constant Detail
-
ENUM_CLASSES
public static final LanguageFeature ENUM_CLASSES
-
FOR_EACH_LOOPS
public static final LanguageFeature FOR_EACH_LOOPS
-
TRY_WITH_RESOURCES
public static final LanguageFeature TRY_WITH_RESOURCES
-
DEFAULT_INTERFACE_METHODS
public static final LanguageFeature DEFAULT_INTERFACE_METHODS
-
STATIC_INTERFACE_METHODS
public static final LanguageFeature STATIC_INTERFACE_METHODS
-
LAMBDA_EXPRESSIONS
public static final LanguageFeature LAMBDA_EXPRESSIONS
-
TRY_EXPRESSION_RESOURCE
public static final LanguageFeature TRY_EXPRESSION_RESOURCE
-
PRIVATE_LOOKUP
public static final LanguageFeature PRIVATE_LOOKUP
-
LOCAL_TYPE_INFERENCE
public static final LanguageFeature LOCAL_TYPE_INFERENCE
-
SWITCH_EXPRESSIONS
public static final LanguageFeature SWITCH_EXPRESSIONS
-
TEXT_BLOCKS
public static final LanguageFeature TEXT_BLOCKS
-
SEALED_CLASSES
public static final LanguageFeature SEALED_CLASSES
-
RECORD_CLASSES
public static final LanguageFeature RECORD_CLASSES
-
PATTERN_MATCHING
public static final LanguageFeature PATTERN_MATCHING
-
-
Field Detail
-
_version
private final CompilerTarget _version
-
_previewVersion
private final CompilerTarget _previewVersion
-
-
Constructor Detail
-
LanguageFeature
private LanguageFeature(CompilerTarget version)
-
LanguageFeature
private LanguageFeature(CompilerTarget version, CompilerTarget previewVersion)
-
-
Method Detail
-
values
public static LanguageFeature[] 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 (LanguageFeature c : LanguageFeature.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static LanguageFeature 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
-
version
public final CompilerTarget version()
-
previewVersion
public final CompilerTarget previewVersion()
-
isAvailable
public final boolean isAvailable(TypeDefinition definition)
-
isAvailable
public final boolean isAvailable(TypeDefinition definition, boolean allowPreview)
-
isAvailable
public final boolean isAvailable(CompilerTarget targetVersion)
-
isAvailable
public final boolean isAvailable(CompilerTarget targetVersion, boolean allowPreview)
-
-