Package org.eclipse.jetty.start
Class Version
- java.lang.Object
-
- org.eclipse.jetty.start.Version
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Version.ParseState
-
Field Summary
Fields Modifier and Type Field Description private int
legacyMajor
The major version for java is always "1" (per legacy versioning history)private int
major
The true major version is the second value ("1.5" == "Java 5", "1.8" = "Java 8", etc..)private int
revision
The revision of the version.private java.lang.String
shortString
Short String versionprivate java.lang.String
string
Original String versionprivate java.lang.String
suffix
Extra versioning information present on the version string, but not relevant for version comparison reason.private int
update
The update (where bug fixes are placed)private java.lang.String
updateString
Update strings may be zero padded!
-
Constructor Summary
Constructors Constructor Description Version(java.lang.String versionString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version other)
int
getLegacyMajor()
int
getMajor()
int
getRevision()
java.lang.String
getSuffix()
int
getUpdate()
boolean
isInRange(Version low, Version high)
Check whether this version is in range of versions specifiedboolean
isNewerThan(Version other)
boolean
isNewerThanOrEqualTo(Version other)
boolean
isOlderThan(Version other)
boolean
isOlderThanOrEqualTo(Version other)
private void
parse(java.lang.String versionStr)
parses version string in the form legacy[.major[.revision[_update[-suffix]]]] into this instance.java.lang.String
toShortString()
Return short string form (without suffix)java.lang.String
toString()
-
-
-
Field Detail
-
string
private java.lang.String string
Original String version
-
shortString
private java.lang.String shortString
Short String version
-
legacyMajor
private int legacyMajor
The major version for java is always "1" (per legacy versioning history)
-
major
private int major
The true major version is the second value ("1.5" == "Java 5", "1.8" = "Java 8", etc..)
-
revision
private int revision
The revision of the version.This value is always "0" (also per legacy versioning history)
-
update
private int update
The update (where bug fixes are placed)
-
updateString
private java.lang.String updateString
Update strings may be zero padded!
-
suffix
private java.lang.String suffix
Extra versioning information present on the version string, but not relevant for version comparison reason. (eg: with "1.8.0_45-internal", the suffix would be "-internal")
-
-
Method Detail
-
compareTo
public int compareTo(Version other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Version>
-
getLegacyMajor
public int getLegacyMajor()
-
getMajor
public int getMajor()
-
getRevision
public int getRevision()
-
getUpdate
public int getUpdate()
-
getSuffix
public java.lang.String getSuffix()
-
isNewerThan
public boolean isNewerThan(Version other)
-
isNewerThanOrEqualTo
public boolean isNewerThanOrEqualTo(Version other)
-
isOlderThan
public boolean isOlderThan(Version other)
-
isOlderThanOrEqualTo
public boolean isOlderThanOrEqualTo(Version other)
-
isInRange
public boolean isInRange(Version low, Version high)
Check whether this version is in range of versions specified- Parameters:
low
- the low part of the rangehigh
- the high part of the range- Returns:
- true if this version is within the provided range
-
parse
private void parse(java.lang.String versionStr)
parses version string in the form legacy[.major[.revision[_update[-suffix]]]] into this instance.- Parameters:
versionStr
- the version string
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- string representation of this version
-
toShortString
public java.lang.String toShortString()
Return short string form (without suffix)- Returns:
- string the short version string form
-
-