org.jboss.deployers.structure.spi.classloading.helpers
Class VersionImpl

java.lang.Object
  extended by org.jboss.deployers.structure.spi.classloading.Version
      extended by org.jboss.deployers.structure.spi.classloading.helpers.VersionImpl
All Implemented Interfaces:
Comparable<Version>

public class VersionImpl
extends Version

VersionImpl. OSGi kind of version impl.

Version:
$Revision: 1.1 $
Author:
Ales Justin, Adrian Brock

Field Summary
 
Fields inherited from class org.jboss.deployers.structure.spi.classloading.Version
DEFAULT_VERSION
 
Constructor Summary
VersionImpl(int major, int minor, int micro)
           
VersionImpl(int major, int minor, int micro, String qualifier)
           
 
Method Summary
 boolean equals(Object object)
           
 int getMajor()
          Returns the major component of this version identifier.
 int getMicro()
          Returns the micro component of this version identifier.
 int getMinor()
          Returns the minor component of this version identifier.
 String getQualifier()
          Returns the qualifier component of this version identifier.
 int hashCode()
           
static VersionImpl parseVersion(String version)
          Parses a version identifier from the specified string.
 String toString()
           
protected  void validate()
          Validate arguments.
 
Methods inherited from class org.jboss.deployers.structure.spi.classloading.Version
compareTo
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro)

VersionImpl

public VersionImpl(int major,
                   int minor,
                   int micro,
                   String qualifier)
Method Detail

validate

protected void validate()
Validate arguments.


parseVersion

public static VersionImpl parseVersion(String version)
Parses a version identifier from the specified string. See Version(String) for the format of the version string.

Parameters:
version - String representation of the version identifier. Leading and trailing whitespace will be ignored.
Returns:
A Version object representing the version identifier. If version is null or the empty string then emptyVersion will be returned.
Throws:
IllegalArgumentException - If version is improperly formatted.

getMajor

public int getMajor()
Returns the major component of this version identifier.

Returns:
The major component.

getMinor

public int getMinor()
Returns the minor component of this version identifier.

Returns:
The minor component.

getMicro

public int getMicro()
Returns the micro component of this version identifier.

Returns:
The micro component.

getQualifier

public String getQualifier()
Returns the qualifier component of this version identifier.

Returns:
The qualifier component.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object object)
Overrides:
equals in class Object


Copyright © 2008 JBoss Inc.. All Rights Reserved.