org.rhq.core.domain.util
Class OSGiVersion

java.lang.Object
  extended by org.rhq.core.domain.util.OSGiVersion

public class OSGiVersion
extends Object

A simple representation of an OSGi formatted version string. All fields except the "major" part of the version can be undefined.


Constructor Summary
OSGiVersion()
           
OSGiVersion(String version)
          Creates new OSGiVersion instance from the version string.
 
Method Summary
 int getMajor()
           
 int getMicro()
           
 Integer getMicroIfDefined()
           
 int getMinor()
           
 Integer getMinorIfDefined()
           
 String getQualifier()
           
static boolean isValid(String version)
           
 void setMajor(int major)
           
 void setMicro(Integer micro)
           
 void setMinor(Integer minor)
           
 void setQualifier(String qualifier)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OSGiVersion

public OSGiVersion()

OSGiVersion

public OSGiVersion(String version)
Creates new OSGiVersion instance from the version string.

Parameters:
version -
Throws:
IllegalArgumentException - if the version string isn't a well-formed OSGi version string.
Method Detail

isValid

public static boolean isValid(String version)

getMajor

public int getMajor()
Returns:
the major

setMajor

public void setMajor(int major)
Parameters:
major - the major to set

getMinorIfDefined

public Integer getMinorIfDefined()
Returns:
the minor

getMinor

public int getMinor()

setMinor

public void setMinor(Integer minor)
Parameters:
minor - the minor to set

getMicro

public int getMicro()
Returns:
the micro

getMicroIfDefined

public Integer getMicroIfDefined()

setMicro

public void setMicro(Integer micro)
Parameters:
micro - the micro to set

getQualifier

public String getQualifier()
Returns:
the qualifier

setQualifier

public void setQualifier(String qualifier)
Parameters:
qualifier - the qualifier to set

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.