public static enum MixinEnvironment.CompatibilityLevel extends java.lang.Enum<MixinEnvironment.CompatibilityLevel>
| Enum Constant and Description |
|---|
JAVA_10
Java 10 or above is required
|
JAVA_11
Java 11 or above is required
|
JAVA_12
Java 12 or above is required
|
JAVA_13
Java 13 or above is required
|
JAVA_14
Java 14 or above is required.
|
JAVA_15
Java 15 or above is required.
|
JAVA_16
Java 16 or above is required
|
JAVA_17
Java 17 or above is required
|
JAVA_18
Java 18 or above is required
|
JAVA_6
Java 6 (1.6) or above is required
|
JAVA_7
Java 7 (1.7) or above is required
|
JAVA_8
Java 8 (1.8) or above is required
|
JAVA_9
Java 9 or above is required
|
| Modifier and Type | Field and Description |
|---|---|
static MixinEnvironment.CompatibilityLevel |
DEFAULT
Default compatibility level to use if not specified by the service
|
static MixinEnvironment.CompatibilityLevel |
MAX_SUPPORTED
Maximum compatibility level actually supported.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canElevateTo(MixinEnvironment.CompatibilityLevel level)
Get whether this level can be elevated to the specified level
|
boolean |
canSupport(MixinEnvironment.CompatibilityLevel level)
True if this level can support the specified level
|
int |
classVersion()
Deprecated.
Use getClassVersion
|
int |
getClassMajorVersion()
Get the major class version expected at this compatibility level
|
int |
getClassVersion()
Class version expected at this compatibility level
|
int |
getLanguageFeatures()
Get all supported language features
|
boolean |
isAtLeast(MixinEnvironment.CompatibilityLevel level)
Get whether this level is the same or greater than the specified
level
|
boolean |
isLessThan(MixinEnvironment.CompatibilityLevel level)
Get whether this level is less than the specified level
|
static MixinEnvironment.CompatibilityLevel |
requiredFor(int languageFeatures)
Return the minimum language level required to support the specified
language feature(s).
|
boolean |
supports(int languageFeatures)
Get whether the specified
LanguageFeatures is supported by
this runtime. |
boolean |
supportsMethodsInInterfaces()
Deprecated.
Use
supports(int) instead |
static MixinEnvironment.CompatibilityLevel |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MixinEnvironment.CompatibilityLevel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MixinEnvironment.CompatibilityLevel JAVA_6
public static final MixinEnvironment.CompatibilityLevel JAVA_7
public static final MixinEnvironment.CompatibilityLevel JAVA_8
public static final MixinEnvironment.CompatibilityLevel JAVA_9
public static final MixinEnvironment.CompatibilityLevel JAVA_10
public static final MixinEnvironment.CompatibilityLevel JAVA_11
public static final MixinEnvironment.CompatibilityLevel JAVA_12
public static final MixinEnvironment.CompatibilityLevel JAVA_13
public static final MixinEnvironment.CompatibilityLevel JAVA_14
public static final MixinEnvironment.CompatibilityLevel JAVA_15
public static final MixinEnvironment.CompatibilityLevel JAVA_16
public static final MixinEnvironment.CompatibilityLevel JAVA_17
public static final MixinEnvironment.CompatibilityLevel JAVA_18
public static MixinEnvironment.CompatibilityLevel DEFAULT
public static MixinEnvironment.CompatibilityLevel MAX_SUPPORTED
This is particularly important for the case where a config declares a higher version (eg. JAVA_14) which has been added to the enum but no code actually exists within Mixin as a library to handle language features from that version. In other words adding values to this enum doesn't magically add support for language features, and this field should point to the highest known supported version regardless of other known versions.
This comment mainly added to avoid stuff in the future like PR #500 which demonstrates that the nature of compatibility levels in mixin are not understood that well.
public static MixinEnvironment.CompatibilityLevel[] values()
for (MixinEnvironment.CompatibilityLevel c : MixinEnvironment.CompatibilityLevel.values()) System.out.println(c);
public static MixinEnvironment.CompatibilityLevel valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is null@Deprecated public int classVersion()
public int getClassVersion()
public int getClassMajorVersion()
public int getLanguageFeatures()
@Deprecated public boolean supportsMethodsInInterfaces()
supports(int) insteadpublic boolean supports(int languageFeatures)
LanguageFeatures is supported by
this runtime.languageFeatures - language feature (or features) to checkpublic boolean isAtLeast(MixinEnvironment.CompatibilityLevel level)
level - level to compare topublic boolean isLessThan(MixinEnvironment.CompatibilityLevel level)
level - level to compare topublic boolean canElevateTo(MixinEnvironment.CompatibilityLevel level)
level - desired levelpublic boolean canSupport(MixinEnvironment.CompatibilityLevel level)
level - desired levelpublic static MixinEnvironment.CompatibilityLevel requiredFor(int languageFeatures)
languageFeatures - Language feature(s) to check for