org.sadun.util
Interface Version

All Known Implementing Classes:
VersionImpl

public interface Version

A generic interface to a version object.

The notion of version supported includes a major, minor and micro number, a quality state (alpha, beta, etc), a build number and a build timestamp.

A typical string denotation has the format major.minor.micro[quality] build [build number, [build timestamp]].

Specific implementation may be created manually, or usually generated at compiletime and included in the versioned package.

Version:
1.0
Author:
Cristiano Sadun

Field Summary
static int NOT_VALUED
          A constant that can be compared to any of the numeric attributes exposed by this class to check wether a valid value or not is assigned to the attribute.
 
Method Summary
 long getBuildNumber()
          Return the build number, or NOT_VALUED if there is no such number.
 long getBuildTimestamp()
          Return the build timestamp, or NOT_VALUED if there is no such timestamp.
 java.lang.String getFullDescription()
          Return a full description of the version.
 int getMajorNumber()
          Return the major version number, or NOT_VALUED if there is no such number.
 int getMicroNumber()
          Return the micro version number, or NOT_VALUED if there is no such number.
 int getMinorNumber()
          Return the minor version number, or NOT_VALUED if there is no such number.
 java.lang.String getQualityState()
          Return the quality state string, or null if none is set.
 java.lang.String getShortDescription()
          Return a short description of the version.
 

Field Detail

NOT_VALUED

public static final int NOT_VALUED
A constant that can be compared to any of the numeric attributes exposed by this class to check wether a valid value or not is assigned to the attribute.

For example, code like if (getMicroNumber()==Version.NOT_VALUED)) ... can be used as necessary to verify if an attribute is valued or not.

See Also:
Constant Field Values
Method Detail

getMajorNumber

public int getMajorNumber()
Return the major version number, or NOT_VALUED if there is no such number.

Returns:
the major version number, or NOT_VALUED if there is no such number.

getMinorNumber

public int getMinorNumber()
Return the minor version number, or NOT_VALUED if there is no such number.

Returns:
the minor version number, or NOT_VALUED if there is no such number.

getMicroNumber

public int getMicroNumber()
Return the micro version number, or NOT_VALUED if there is no such number.

Returns:
the micro version number, or NOT_VALUED if there is no such number.

getQualityState

public java.lang.String getQualityState()
Return the quality state string, or null if none is set.

Returns:
the quality state string, or null if none is set.

getBuildNumber

public long getBuildNumber()
Return the build number, or NOT_VALUED if there is no such number.

Returns:
the build number, or NOT_VALUED if there is no such number.

getBuildTimestamp

public long getBuildTimestamp()
Return the build timestamp, or NOT_VALUED if there is no such timestamp.

Returns:
the build timestamp, or NOT_VALUED if there is no such timestamp.

getShortDescription

public java.lang.String getShortDescription()
Return a short description of the version. This is typically limited to major.micro number.

Returns:
a short description of the version. This is typically limited to major.micro number.

getFullDescription

public java.lang.String getFullDescription()
Return a full description of the version.

Returns:
a full description of the version.