public enum EJavaVersion extends Enum<EJavaVersion>
| Enum Constant and Description |
|---|
JDK_1_1 |
JDK_1_2 |
JDK_1_3 |
JDK_1_4 |
JDK_1_5 |
JDK_1_6 |
JDK_1_7 |
JDK_1_8 |
JDK_10 |
JDK_11 |
JDK_12 |
JDK_13 |
JDK_14 |
JDK_15 |
JDK_16 |
JDK_17 |
JDK_9 |
UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
static EJavaVersion |
getCurrentVersion() |
static EJavaVersion |
getFromMajorAndMinor(int nMajor,
int nMinor)
Get the matching Java version from a class version.
|
static EJavaVersion |
getFromVersionNumber(double dVersion) |
boolean |
isCurrentVersion() |
protected boolean |
isMatchingVersion(double dVersion) |
boolean |
isNewerOrEqualsThan(EJavaVersion eJavaVersion)
Check if this java version is newer or equals than the passed version
|
boolean |
isOlderOrEqualsThan(EJavaVersion eJavaVersion)
Check if this java version is older or equals than the passed version
|
boolean |
isSupportedVersion() |
static EJavaVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EJavaVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EJavaVersion UNKNOWN
public static final EJavaVersion JDK_1_1
public static final EJavaVersion JDK_1_2
public static final EJavaVersion JDK_1_3
public static final EJavaVersion JDK_1_4
public static final EJavaVersion JDK_1_5
public static final EJavaVersion JDK_1_6
public static final EJavaVersion JDK_1_7
public static final EJavaVersion JDK_1_8
public static final EJavaVersion JDK_9
public static final EJavaVersion JDK_10
public static final EJavaVersion JDK_11
public static final EJavaVersion JDK_12
public static final EJavaVersion JDK_13
public static final EJavaVersion JDK_14
public static final EJavaVersion JDK_15
public static final EJavaVersion JDK_16
public static final EJavaVersion JDK_17
public static EJavaVersion[] values()
for (EJavaVersion c : EJavaVersion.values()) System.out.println(c);
public static EJavaVersion valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullprotected boolean isMatchingVersion(double dVersion)
public boolean isCurrentVersion()
true if this is the current version,
false otherwisepublic boolean isSupportedVersion()
true if this Java version is supported by the current
Java Version. It is expected that all versions are backward
compatible.public boolean isOlderOrEqualsThan(@Nonnull EJavaVersion eJavaVersion)
eJavaVersion - the Java version to be checked. May not be null.true if this Java version is old or equal than the
passed version.public boolean isNewerOrEqualsThan(@Nonnull EJavaVersion eJavaVersion)
eJavaVersion - the Java version to be checked. May not be null.true if this Java version is newer or equal than the
passed version.@Nonnull public static EJavaVersion getCurrentVersion()
UNKNOWN is returned and never
null.@Nonnull public static EJavaVersion getFromMajorAndMinor(int nMajor, int nMinor)
nMajor - Major version numbernMinor - Minor version numberUNKNOWN if the version could not be determined.@Nonnull public static EJavaVersion getFromVersionNumber(double dVersion)
Copyright © 2014–2022 Philip Helger. All rights reserved.