org.jasig.portal.tools.versioning
Class Version

java.lang.Object
  extended by org.jasig.portal.tools.versioning.Version

public class Version
extends Object

Represents the version of a specific unit of code that is currently installed in the portal. The unit of code is represented by its functional name. For the portal codebase this functional name uses the value of the IPermission interface, PORTAL_FRAMEWORK variable which currently is "UP_FRAMEWORK". The version of a specific piece of code is represented by three integers. In most significant order these are Major, Minor, and Micro.

Version:
$Revision: 19776 $
Author:
Mark Boyd mark.boyd@engineer.com

Constructor Summary
Version(String fname, String description, int major, int minor, int micro)
          Only the versioning package classes are expected to create these objects.
 
Method Summary
 String dottedTriple()
          Returns a String of the form "2.5.4".
 boolean equals(Object obj)
          Returns true of the passed in object is a Version object and the functional names of the objects are equal and the version numbers within this class are equal to those of the passed in version object.
 boolean equalTo(Version v)
          Returns true of the version represented by this class is equal to that represented by the passed in version object.
 String getDescription()
          Returns the description of the unit of code for which this object represents the version of this code that is currently installed in the portal.
 String getFname()
          Returns the functional name of the unit of code for which this object represents the version of this code that is currently installed in the portal.
 int getMajor()
          The major version of the code represented by this object.
 int getMicro()
          The micro version of the code represented by this object.
 int getMinor()
          The minor version of the code represented by this object.
 boolean greaterThan(Version v)
          Returns true of the version represented by this class is greater than that represented by the passed in version object.
 boolean lessThan(Version v)
          Returns true of the version represented by this class is less than that represented by the passed in version object.
 String toString()
          Returns a string representation of the version.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(String fname,
               String description,
               int major,
               int minor,
               int micro)
Only the versioning package classes are expected to create these objects.

Parameters:
fname - the functional name of the code being represented
major - the major version of this code
minor - the minor version of this code
micro - the micro version of this code
Method Detail

getFname

public String getFname()
Returns the functional name of the unit of code for which this object represents the version of this code that is currently installed in the portal.

Returns:
String

getDescription

public String getDescription()
Returns the description of the unit of code for which this object represents the version of this code that is currently installed in the portal.

Returns:
String

getMajor

public int getMajor()
The major version of the code represented by this object.

Returns:
int

getMinor

public int getMinor()
The minor version of the code represented by this object.

Returns:
int

getMicro

public int getMicro()
The micro version of the code represented by this object.

Returns:
int

toString

public String toString()
Returns a string representation of the version. The format is: : ..

Overrides:
toString in class Object
Returns:
java.lang.String

equals

public boolean equals(Object obj)
Returns true of the passed in object is a Version object and the functional names of the objects are equal and the version numbers within this class are equal to those of the passed in version object.

Overrides:
equals in class Object
Parameters:
obj - a Version object to be compared to this one
Returns:
boolean true if the above conditions are met

equalTo

public boolean equalTo(Version v)
Returns true of the version represented by this class is equal to that represented by the passed in version object. The functional name is not queried for this evaluation. Only version numbers are compared.

Parameters:
v - the version to be compared with this version
Returns:
boolean true if this version is equal to the passed in version

lessThan

public boolean lessThan(Version v)
Returns true of the version represented by this class is less than that represented by the passed in version object. The functional name is not queried for this evaluation. Only version numbers are compared.

Parameters:
v - the version to be compared with this version
Returns:
boolean true if this version is less than to the passed in version

greaterThan

public boolean greaterThan(Version v)
Returns true of the version represented by this class is greater than that represented by the passed in version object. The functional name is not queried for this evaluation. Only version numbers are compared.

Parameters:
v - the version to be compared with this version
Returns:
boolean true if this version is greater than to the passed in version

dottedTriple

public String dottedTriple()
Returns a String of the form "2.5.4".

Returns:
a String representing the dotted triple version


Copyright © 2010 Jasig. All Rights Reserved.