public class OSGiVersion extends BasicVersion
emptyVersion, MAX_VERSION, RAW_PREFIX| Constructor and Description |
|---|
OSGiVersion(int major,
int minor,
int micro,
java.lang.Comparable<? extends java.lang.Object> qualifier) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Version v) |
boolean |
equals(java.lang.Object object) |
IVersionFormat |
getFormat()
Returns the optional format.
|
int |
getMajor()
Returns the OSGi major component of this version identifier.
|
int |
getMicro()
Returns the OSGi micro component of this version identifier.
|
int |
getMinor()
Returns the OSGi minor component of this version identifier.
|
java.lang.String |
getOriginal()
Returns the
original part of the string for this version
or null if no such part was provided when the version was
created. |
java.lang.Comparable<?> |
getPad()
Returns the pad value used when comparing this versions to
versions that has a larger number of segments
|
java.lang.String |
getQualifier()
Returns the OSGi qualifier component of this version identifier.
|
java.lang.Comparable<?> |
getSegment(int index)
An element from the raw vector representation of this version.
|
int |
getSegmentCount()
Returns the number of elements in the raw vector representation of this version.
|
java.lang.Comparable<?>[] |
getVector()
This method is package protected since it violates the immutable
contract.
|
int |
hashCode() |
boolean |
isOSGiCompatible()
Checks if this version is in compliance with the OSGi version spec.
|
static boolean |
isValidOSGiQualifier(java.lang.Comparable<?> e) |
void |
originalToString(java.lang.StringBuffer sb,
boolean rangeSafe)
Appends the original for this version onto the
sb StringBuffer
if present. |
void |
rawToString(java.lang.StringBuffer sb,
boolean rangeSafe)
Appends the raw format for this version onto the
sb StringBuffer. |
void |
toString(java.lang.StringBuffer sb)
Appends the string representation of this version onto the
sb StringBuffer. |
compile, create, createOSGi, createOSGi, parseVersion, toStringpublic OSGiVersion(int major,
int minor,
int micro,
java.lang.Comparable<? extends java.lang.Object> qualifier)
public static boolean isValidOSGiQualifier(java.lang.Comparable<?> e)
public int compareTo(Version v)
public boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic IVersionFormat getFormat()
Versionpublic int getMajor()
BasicVersiongetMajor in class BasicVersionVersion.isOSGiCompatible()public int getMicro()
BasicVersiongetMicro in class BasicVersionVersion.isOSGiCompatible()public int getMinor()
BasicVersiongetMinor in class BasicVersionVersion.isOSGiCompatible()public java.lang.String getOriginal()
Versionoriginal part of the string for this version
or null if no such part was provided when the version was
created. An OSGi type version will always return the OSGi string representation.getOriginal in class Versionoriginal part of the version string or
null if that part was missing.public java.lang.String getQualifier()
BasicVersiongetQualifier in class BasicVersionnull if not set.Version.isOSGiCompatible()public int hashCode()
hashCode in class java.lang.Objectpublic boolean isOSGiCompatible()
VersionisOSGiCompatible in class Versionpublic void originalToString(java.lang.StringBuffer sb,
boolean rangeSafe)
BasicVersionsb StringBuffer
if present.originalToString in class BasicVersionsb - The buffer that will receive the raw string formatrangeSafe - Set to true if range delimiters should be escapedpublic void rawToString(java.lang.StringBuffer sb,
boolean rangeSafe)
BasicVersionsb StringBuffer.rawToString in class BasicVersionsb - The buffer that will receive the raw string formatrangeSafe - Set to true if range delimiters should be escapedpublic void toString(java.lang.StringBuffer sb)
Versionsb StringBuffer.public java.lang.Comparable<?>[] getVector()
BasicVersionpublic java.lang.Comparable<?> getPad()
Versionpublic java.lang.Comparable<?> getSegment(int index)
VersiongetSegment in class Versionindex - The zero based index of the desired elementpublic int getSegmentCount()
VersiongetSegmentCount in class Version