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.version
public static final JavaVersion JAVA_VERSION
java.version
public static JavaVersion parse(String s)
compareTo(JavaVersion)
s
- the version string, never null
public 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 false
public boolean isBefore(String other)
other
- the version to compare withtrue
is this is less than other
, otherwise false
public boolean isAtLeast(JavaVersion other)
other
- the version to compare withtrue
is this is greater than or equal to other
, otherwise false
public boolean isAtLeast(String other)
other
- the version to compare withtrue
is this is greater than or equal to other
, otherwise false
public JavaVersion asMajor()
"1."
, then remove this part from the versionCopyright © 2001–2018 Codehaus Plexus. All rights reserved.