Comparable<JavaVersion>public class JavaVersion extends Object implements Comparable<JavaVersion>
| Modifier and Type | Field | Description |
|---|---|---|
static JavaVersion |
JAVA_SPECIFICATION_VERSION |
Represents the System property
java.specification.version |
static JavaVersion |
JAVA_VERSION |
Represents the System property
java.version |
| Modifier and Type | Method | Description |
|---|---|---|
JavaVersion |
asMajor() |
If original version starts with
"1.", then remove this part from the version |
int |
compareTo(JavaVersion other) |
|
boolean |
equals(Object obj) |
|
int |
hashCode() |
|
boolean |
isAtLeast(String other) |
Verify if this version is at least some other version
|
boolean |
isAtLeast(JavaVersion other) |
Verify if this version is at least some other version
|
boolean |
isBefore(String other) |
Verify if this version is before some other version
|
boolean |
isBefore(JavaVersion other) |
Verify if this version is before some other version
|
static JavaVersion |
parse(String s) |
Lazy parse the version-scheme.
|
String |
toString() |
public static final JavaVersion JAVA_SPECIFICATION_VERSION
java.specification.versionpublic static final JavaVersion JAVA_VERSION
java.versionpublic static JavaVersion parse(String s)
compareTo(JavaVersion)s - the version string, never nullpublic int compareTo(JavaVersion other)
compareTo in interface Comparable<JavaVersion>public boolean isBefore(JavaVersion other)
other - the version to compare withtrue is this is less than other, otherwise falsepublic boolean isBefore(String other)
other - the version to compare withtrue is this is less than other, otherwise falsepublic boolean isAtLeast(JavaVersion other)
other - the version to compare withtrue is this is greater than or equal to other, otherwise falsepublic boolean isAtLeast(String other)
other - the version to compare withtrue is this is greater than or equal to other, otherwise falsepublic JavaVersion asMajor()
"1.", then remove this part from the versionCopyright © 2001–2018 Codehaus Plexus. All rights reserved.