public class JavaVersion extends java.lang.Object implements java.lang.Comparable<JavaVersion>
| Modifier and Type | Field and Description |
|---|---|
static JavaVersion |
JAVA_SPECIFICATION_VERSION
Represents the System property
java.specification.version |
static JavaVersion |
JAVA_VERSION
Represents the System property
java.version |
private java.lang.String |
rawVersion |
private static java.util.regex.Pattern |
startingDigits |
| Modifier | Constructor and Description |
|---|---|
private |
JavaVersion(java.lang.String rawVersion) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(JavaVersion other) |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isAtLeast(JavaVersion other)
Verify if this version is at least some other version
|
boolean |
isAtLeast(java.lang.String other)
Verify if this version is at least some other version
|
boolean |
isBefore(JavaVersion other)
Verify if this version is before some other version
|
boolean |
isBefore(java.lang.String other)
Verify if this version is before some other version
|
static JavaVersion |
parse(java.lang.String s)
Lazy parse the version-scheme.
|
private int |
suffixRate(java.lang.String suffix) |
java.lang.String |
toString() |
public static final JavaVersion JAVA_SPECIFICATION_VERSION
java.specification.versionpublic static final JavaVersion JAVA_VERSION
java.versionprivate static final java.util.regex.Pattern startingDigits
private java.lang.String rawVersion
public static JavaVersion parse(java.lang.String s)
compareTo(JavaVersion)s - the version stringpublic int compareTo(JavaVersion other)
compareTo in interface java.lang.Comparable<JavaVersion>private int suffixRate(java.lang.String suffix)
public boolean isBefore(JavaVersion other)
other - the version to compare withtrue is this is less than other, otherwise falsepublic boolean isBefore(java.lang.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(java.lang.String other)
other - the version to compare withtrue is this is greater than or equal to other, otherwise falsepublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object