Package org.springframework.boot.system
Enum Class JavaVersion
- All Implemented Interfaces:
Serializable
,Comparable<JavaVersion>
,Constable
Known Java versions.
- Since:
- 2.0.0
- Author:
- Oliver Gierke, Phillip Webb, Moritz Halbritter
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionJava 18.Java 19.Java 17.Java 20.Java 21. -
Method Summary
Modifier and TypeMethodDescriptionstatic JavaVersion
Returns theJavaVersion
of the current runtime.boolean
isEqualOrNewerThan
(JavaVersion version) Return if this version is equal to or newer than a given version.boolean
isOlderThan
(JavaVersion version) Return if this version is older than a given version.toString()
static JavaVersion
Returns 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
-
SEVENTEEN
Java 17. -
EIGHTEEN
Java 18. -
NINETEEN
Java 19. -
TWENTY
Java 20. -
TWENTY_ONE
Java 21.
-
-
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
-
toString
- Overrides:
toString
in classEnum<JavaVersion>
-
getJavaVersion
Returns theJavaVersion
of 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:
true
if 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:
true
if this version is older thanversion
-