public final class VersionTypeImpl extends Object implements VersionType, Serializable, Comparable<VersionType>, Cloneable, CommonConstants
Implements a 2-byte version number, consisting of a major and minor component.
A persistent representation of a product version may be represented by the following columns in a database:
'VersionType_major' tinyint(4) NOT NULL,
'VersionType_minor' tinyint(4) NOT NULL
| Modifier and Type | Field and Description |
|---|---|
static String |
MYSQL_COLUMN_DEFINITION |
AAF_METADICT_NAMESPACE, AAF_METADICT_PREFIX, AAF_XML_NAMESPACE, AAF_XML_PREFIX, ApplicationPluginObjectID, ApplicationPluginsID, MAX_NUM_RGBA_COMPS, MemberOfID, ObjectClassID, ParentClassID, PropertiesID, XMLClassIDAsAttributeName| Constructor and Description |
|---|
VersionTypeImpl()
Create a new version number, set to "
0.0". |
VersionTypeImpl(byte major,
byte minor)
Create a version number from its major and minor component.
|
| Modifier and Type | Method and Description |
|---|---|
VersionType |
clone()
Create a cloned copy of this version value.
|
int |
compareTo(VersionType o)
Compare this version number to the given version number.
|
boolean |
equals(Object o) |
static String |
format(VersionTypeImpl version)
Format a version number as a string.
|
static VersionType |
fromPersistentForm(String version) |
String |
getEventComment() |
byte |
getMajor()
Returns the major component of the version number.
|
byte |
getMinor()
Returns the minor component of the version number.
|
int |
hashCode() |
static VersionTypeImpl |
parseFactory(String versionAsString)
Parse a string representation of a version number and create a value of this
class.
|
void |
setMajor(byte major)
Sets the major component of the version number.
|
void |
setMinor(byte minor)
Sets the minor component of the version number.
|
static String |
toPersistentForm(VersionType version) |
String |
toString()
Formats the version number as a string representation.
|
public static final String MYSQL_COLUMN_DEFINITION
public VersionTypeImpl(@Int8 byte major, @Int8 byte minor)
Create a version number from its major and minor component.
major - Major component of version number.minor - Minor component of version number.public VersionTypeImpl()
Create a new version number, set to "0.0".
public final byte getMajor()
VersionTypeReturns the major component of the version number.
getMajor in interface VersionTypepublic final void setMajor(byte major)
VersionTypeSets the major component of the version number.
setMajor in interface VersionTypemajor - Major component of the version number.public final byte getMinor()
VersionTypeReturns the minor component of the version number.
getMinor in interface VersionTypepublic void setMinor(byte minor)
VersionTypeSets the minor component of the version number.
setMinor in interface VersionTypeminor - Minor component of the version number.public final String toString()
Formats the version number as a string representation. This format is:
.<minor>Note that "2.10" is a later version than "2.9".
toString in interface VersionTypetoString in class ObjectObject.toString()public static final VersionTypeImpl parseFactory(String versionAsString) throws NullPointerException, ParseException
Parse a string representation of a version number and create a value of this
class. The value must contain a '.' to be valid. The major and minor
parts of the version numbers, before and after the dot respectively, must range between
0 and 255.
versionAsString - String representation of a version number.NullPointerException - The given version number string is null.ParseException - The given version number string causes parse or number range errors
that prevent it from being converted into a version number value.public final int compareTo(VersionType o) throws NullPointerException
Compare this version number to the given version number.
compareTo in interface Comparable<VersionType>compareTo in interface VersionTypeo - Version number to compare with this one.-1 if this version number is less than the given one,
1 if this version is greater and 0 if the two version
numbers and equal.NullPointerException - The given value is null.Comparable.compareTo(Object)public final VersionType clone()
VersionTypeCreate a cloned copy of this version value.
clone in interface VersionTypeclone in class Objectpublic static final String format(VersionTypeImpl version) throws NullPointerException
Format a version number as a string.
version - Version number value to format as a string.NullPointerException - Version value is null.public String getEventComment()
public static final String toPersistentForm(VersionType version)
public static final VersionType fromPersistentForm(String version)
(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.