Package com.github.toolarium.common.util
Enum Class JavaVersion
- All Implemented Interfaces:
Serializable,Comparable<JavaVersion>,Constable
The java version information.
See https://javaalmanac.io/bytecode/versions/
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaVersionconvertJavaVersion(String version) Convert java versionGet the class versionGet the java versionstatic JavaVersionGet the Java version as stringprotected static JavaVersionresolveJavaVersion(int majorInput, int minorInput) Resolve the java versionstatic JavaVersionresolveJavaVersion(InputStream classStream) Read the java version informationstatic JavaVersionresolveJavaVersion(String classFilename) Read the java version informationtoString()static JavaVersionReturns the enum constant of this class with the specified name.static JavaVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JAVA_1_1
-
JAVA_1_2
-
JAVA_1_3
-
JAVA_1_4
-
JAVA_1_5
-
JAVA_1_6
-
JAVA_1_7
-
JAVA_1_8
-
JAVA_9
-
JAVA_10
-
JAVA_11
-
JAVA_12
-
JAVA_13
-
JAVA_14
-
JAVA_15
-
JAVA_16
-
JAVA_17
-
JAVA_18
-
JAVA_19
-
JAVA_20
-
JAVA_21
-
JAVA_22
-
JAVA_23
-
JAVA_24
-
JAVA_25
-
JAVA_26
-
-
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
-
getJavaVersion
Get the java version- Returns:
- the java version
-
getClassVersion
Get the class version- Returns:
- the class version
-
toString
- Overrides:
toStringin classEnum<JavaVersion>- See Also:
-
resolveJavaVersion
Get the Java version as string- Returns:
- the java version as string
-
resolveJavaVersion
Read the java version information- Parameters:
classFilename- the class filename- Returns:
- the java version information
- Throws:
IOException- in case of error
-
resolveJavaVersion
Read the java version information- Parameters:
classStream- the class file stream- Returns:
- the java version information
- Throws:
IOException- in case of error
-
resolveJavaVersion
Resolve the java version- Parameters:
majorInput- the major versionminorInput- the minor version- Returns:
- the java version information
-
convertJavaVersion
Convert java version- Parameters:
version- the version number- Returns:
- the java version information
-