com.atlassian.jira.util.system
Class VersionNumber

java.lang.Object
  extended by com.atlassian.jira.util.system.VersionNumber
All Implemented Interfaces:
Comparable

public class VersionNumber
extends Object
implements Comparable

Version Number holder. Implementation from the Mylyn JIRA Connector project. Added isGreaterThan etc. convenience methods.

Doesn't handle things like 3.3rc1 (will actually parse as 3.31 which will be > 3.3)

Author:
Eugene Kuleshov

Constructor Summary
VersionNumber(String version)
           
VersionNumber(String version, String splitterRegex)
           
 
Method Summary
 int compareTo(Object v)
           
 int compareTo(VersionNumber versionNumber)
           
 boolean equals(Object v)
           
 int hashCode()
           
 boolean isGreaterThan(Object v)
           
 boolean isGreaterThanOrEquals(Object v)
           
 boolean isLessThan(Object v)
           
 boolean isLessThanOrEquals(Object v)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionNumber

public VersionNumber(String version)

VersionNumber

public VersionNumber(String version,
                     String splitterRegex)
Method Detail

compareTo

public int compareTo(Object v)
Specified by:
compareTo in interface Comparable

compareTo

public int compareTo(VersionNumber versionNumber)

isGreaterThan

public boolean isGreaterThan(Object v)

isGreaterThanOrEquals

public boolean isGreaterThanOrEquals(Object v)

isLessThan

public boolean isLessThan(Object v)

isLessThanOrEquals

public boolean isLessThanOrEquals(Object v)

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2008 Atlassian. All Rights Reserved.