Package org.springframework.boot.system
Enum JavaVersion
- All Implemented Interfaces:
Serializable,Comparable<JavaVersion>,Constable
Known Java versions.
- Since:
- 2.0.0
- Author:
- Oliver Gierke, Phillip Webb
-
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 JavaVersionReturns theJavaVersionof the current runtime.booleanisEqualOrNewerThan(JavaVersion version) Return if this version is equal to or newer than a given version.booleanisOlderThan(JavaVersion version) Return if this version is older than a given version.toString()static JavaVersionReturns the enum constant of this type with the specified name.static JavaVersion[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SEVENTEEN
Java 17. -
EIGHTEEN
Java 18.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
toString
- Overrides:
toStringin classEnum<JavaVersion>
-
getJavaVersion
Returns theJavaVersionof the current runtime.- Returns:
- the
JavaVersion
-
isEqualOrNewerThan
Return if this version is equal to or newer than a given version.- Parameters:
version- the version to compare- Returns:
trueif this version is equal to or newer thanversion
-
isOlderThan
Return if this version is older than a given version.- Parameters:
version- the version to compare- Returns:
trueif this version is older thanversion
-