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
-
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.
-
-
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
-