Package org.identityconnectors.common
Class Version
java.lang.Object
org.identityconnectors.common.Version
- All Implemented Interfaces:
Comparable<Version>
Encapsulates a version number. A version number is composed of up to four
components: major, minor, micro and specification number.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionintstatic VersionCreates a new version from components.booleangetMajor()Returns this version number's major component.getMicro()Returns this version number's minor component.getMinor()Returns this version number's minor component.Returns this version number's minor component.Returns this version as a string.inthashCode()static VersionParses the passed version string.toString()
-
Method Details
-
parse
Parses the passed version string. The string can contain up to four numeric component separated by a dot, followed by an alphanumberic qualifier prepended by a dash. For example, the following are valid versions:- 1
- 1.1
- 1.1.0
- 1.2.3-alpha
- 1.2.3.4-SNAPSHOT
- Parameters:
version- the version string.
-
create
Creates a new version from components.- Parameters:
components- the components
-
getMajor
Returns this version number's major component.- Returns:
- the major component; never null.
-
getMinor
Returns this version number's minor component.- Returns:
- the minor component or
nullif this version number doesn't have a minor component.
-
getMicro
Returns this version number's minor component.- Returns:
- the minor component or
nullif this version number doesn't have a minor component.
-
getRevision
Returns this version number's minor component.- Returns:
- the minor component or
nullif this version number doesn't have a revision component.
-
getVersion
Returns this version as a string.- Returns:
- this version as a string.
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
toString
-