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 intThe major version for java is always "1" (per legacy versioning history)private intThe true major version is the second value ("1.5" == "Java 5", "1.8" = "Java 8", etc..)private intThe revision of the version.private StringShort String versionprivate StringOriginal String versionprivate StringExtra versioning information present on the version string, but not relevant for version comparison reason.private intThe update (where bug fixes are placed)private StringUpdate strings may be zero padded! -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintgetMajor()intintbooleanCheck whether this version is in range of versions specifiedbooleanisNewerThan(Version other) booleanisNewerThanOrEqualTo(Version other) booleanisOlderThan(Version other) booleanisOlderThanOrEqualTo(Version other) private voidparses 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:
compareToin interfaceComparable<Version>
-
getLegacyMajor
public int getLegacyMajor() -
getMajor
public int getMajor() -
getRevision
public int getRevision() -
getUpdate
public int getUpdate() -
getSuffix
-
isNewerThan
-
isNewerThanOrEqualTo
-
isOlderThan
-
isOlderThanOrEqualTo
-
isInRange
-
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
-