public class JavaVersion
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static JavaVersion |
JAVA_1_5
StaticConstant for Java 1.5 (Tiger).
|
| Constructor and Description |
|---|
JavaVersion(int major,
int minor)
Constructor.
|
JavaVersion(java.lang.String versionString)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMajor()
Get the major version number.
|
int |
getMinor()
Get the minor version number.
|
java.lang.String |
getRest()
Get the rest of the version string after the major and minor numbers.
|
static JavaVersion |
getRuntimeVersion()
Get the version of Java that we are currently running under.
|
boolean |
isSameOrNewerThan(JavaVersion other)
Return whether the Java version represented by this object is at least as
recent as the one given.
|
java.lang.String |
toString() |
public static final JavaVersion JAVA_1_5
public JavaVersion(java.lang.String versionString)
throws JavaVersionException
versionString - a version string, as returned from the
java.version system property: e.g., "1.4.2_04"JavaVersionExceptionpublic JavaVersion(int major,
int minor)
major - major versionminor - minor versionpublic int getMajor()
public int getMinor()
public java.lang.String getRest()
public java.lang.String toString()
toString in class java.lang.Objectpublic static JavaVersion getRuntimeVersion()
public boolean isSameOrNewerThan(JavaVersion other)
other - another JavaVersionSpotBugs is licensed under the LGPL.