Package org.eclipse.jetty.start
Class Version
java.lang.Object
org.eclipse.jetty.start.Version
- All Implemented Interfaces:
Comparable<Version>
Utility class for parsing and comparing version strings.
http://www.oracle.com/technetwork/java/javase/namechange-140185.html
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The major version for java is always "1" (per legacy versioning history)private int
The true major version is the second value ("1.5" == "Java 5", "1.8" = "Java 8", etc..)private int
The revision of the version.private String
Short String versionprivate String
Original String versionprivate String
Extra versioning information present on the version string, but not relevant for version comparison reason.private int
The update (where bug fixes are placed)private String
Update strings may be zero padded! -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
getMajor()
int
int
boolean
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
parses version string in the form legacy[.major[.revision[_update[-suffix]]]] into this instance.Return short string form (without suffix)toString()
-
Field Details
-
string
Original String version -
shortString
Short String version -
legacyMajor
private int legacyMajorThe major version for java is always "1" (per legacy versioning history) -
major
private int majorThe true major version is the second value ("1.5" == "Java 5", "1.8" = "Java 8", etc..) -
revision
private int revisionThe revision of the version.This value is always "0" (also per legacy versioning history)
-
update
private int updateThe update (where bug fixes are placed) -
updateString
Update strings may be zero padded! -
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")
-
-
Constructor Details
-
Version
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
getLegacyMajor
public int getLegacyMajor() -
getMajor
public int getMajor() -
getRevision
public int getRevision() -
getUpdate
public int getUpdate() -
getSuffix
-
isNewerThan
-
isNewerThanOrEqualTo
-
isOlderThan
-
isOlderThanOrEqualTo
-
isInRange
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
parses version string in the form legacy[.major[.revision[_update[-suffix]]]] into this instance.- Parameters:
versionStr
- the version string
-
toString
-
toShortString
Return short string form (without suffix)- Returns:
- string the short version string form
-