Package com.atlassian.bamboo.util
Class Version
java.lang.Object
com.atlassian.bamboo.util.Version
- All Implemented Interfaces:
Comparable<Version>
Use this class to compare different versions.
Supports only major.minor.micro format. Each field is number
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
getMajor()
int
getMicro()
int
getMinor()
int
hashCode()
boolean
isGreaterOrEqualTo
(@NotNull Version version) boolean
isGreaterThan
(@NotNull Version version) boolean
isLessThan
(@NotNull Version version) static Version
Supported formats: - 1.2.3 - 1.2 - 1 all optionally followed by non digit or dot trailing characters.static Version
Supported formats: - 1.2.3 - 1.2 - 1void
setProductName
(String productName) void
setVersionString
(String versionString) toString()
-
Constructor Details
-
Version
public Version(int major, int minor, int micro) -
Version
public Version(int major, int minor) -
Version
public Version(int major)
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
isGreaterThan
-
isGreaterOrEqualTo
-
isLessThan
-
of
Supported formats: - 1.2.3 - 1.2 - 1- Parameters:
version
- to be parsed- Returns:
- Version
- Throws:
IllegalArgumentException
- if can't parse
-
lenient
Supported formats: - 1.2.3 - 1.2 - 1 all optionally followed by non digit or dot trailing characters.- Parameters:
version
- to be parsed- Returns:
- Version
- Throws:
IllegalArgumentException
- if can't parse
-
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getMicro
public int getMicro() -
equals
-
hashCode
public int hashCode() -
toString
-
setVersionString
-
setProductName
-