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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanintgetMajor()intgetMicro()intgetMinor()inthashCode()booleanisGreaterOrEqualTo(@NotNull Version version) booleanisGreaterThan(@NotNull Version version) booleanisLessThan(@NotNull Version version) static VersionSupported formats: - 1.2.3 - 1.2 - 1 all optionally followed by non digit or dot trailing characters.static VersionSupported formats: - 1.2.3 - 1.2 - 1voidsetProductName(String productName) voidsetVersionString(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:
compareToin 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
-