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
-
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 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
-
EIGHT
Java 1.8. -
NINE
Java 9. -
TEN
Java 10. -
ELEVEN
Java 11. -
TWELVE
Java 12. -
THIRTEEN
Java 13. -
FOURTEEN
Java 14. -
FIFTEEN
Java 15. -
SIXTEEN
Java 16. -
SEVENTEEN
Java 17.
-
-
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:
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
-