Package org.gradle.jvm.toolchain
Schnittstelle JavaLanguageVersion
- Alle Superschnittstellen:
Comparable<JavaLanguageVersion>
Represents a Java Language version
- Seit:
- 6.7
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungintasInt()Return this version as a number, 14 for Java 14.booleancanCompileOrRun(int otherVersion) Indicates if this version can compile or run code based on the passed in language version.booleanIndicates if this version can compile or run code based on the passed in language version.static JavaLanguageVersioncurrent()Get the current (i.e., the current runtime) Java Language version.static JavaLanguageVersionof(int version) static JavaLanguageVersiontoString()Return this version as a String, "14" for Java 14.Von Schnittstelle geerbte Methoden java.lang.Comparable
compareTo
-
Methodendetails
-
of
-
of
-
current
Get the current (i.e., the current runtime) Java Language version.- Gibt zurück:
- the current Java Language version
- Seit:
- 8.8
-
asInt
int asInt()Return this version as a number, 14 for Java 14.Given the type used, this method returns the simple version even for versions lower than 5.
- Gibt zurück:
- the version number
- Siehe auch:
-
toString
String toString()Return this version as a String, "14" for Java 14.This method will return
1.<version>when the version is lower than 5. -
canCompileOrRun
Indicates if this version can compile or run code based on the passed in language version.For example, Java 14 can compile or run code from Java 11, but not the opposite.
- Parameter:
other- the language version to check- Gibt zurück:
trueif this version can compile or run code from the other version,falseotherwise
-
canCompileOrRun
boolean canCompileOrRun(int otherVersion) Indicates if this version can compile or run code based on the passed in language version.For example, Java 14 can compile or run code from Java 11, but not the opposite.
- Parameter:
otherVersion- the language version to check, as anint- Gibt zurück:
trueif this version can compile or run code from the other version,falseotherwise
-