Class Version
- java.lang.Object
-
- org.apache.sling.provisioning.model.Version
-
- All Implemented Interfaces:
Comparable<Version>
public class Version extends Object implements Comparable<Version>
Version object supporting Maven and OSGi versions.- Since:
- 1.4
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version other)
Compares thisVersion
object to anotherVersion
.boolean
equals(Object obj)
int
getMajorVersion()
Get the major versionint
getMicroVersion()
Get the minor versionint
getMinorVersion()
Get the major versionString
getQualifier()
Get the qualifierint
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Version
public Version(String version)
Creates a version identifier from the specified string.- Throws:
IllegalArgumentException
- if the version string can't be parsed
-
-
Method Detail
-
getMajorVersion
public int getMajorVersion()
Get the major version- Returns:
- The major version
- Since:
- 1.8.0
-
getMinorVersion
public int getMinorVersion()
Get the major version- Returns:
- The major version
- Since:
- 1.8.0
-
getMicroVersion
public int getMicroVersion()
Get the minor version- Returns:
- The minor version
- Since:
- 1.8.0
-
getQualifier
public String getQualifier()
Get the qualifier- Returns:
- The qualifier, the qualifier might be the empty string.
- Since:
- 1.8.0
-
compareTo
public int compareTo(Version other)
Compares thisVersion
object to anotherVersion
.- Specified by:
compareTo
in interfaceComparable<Version>
-
-