|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecttv.amwa.maj.embeddable.ProductVersion
public final class ProductVersion
Implementation of a version number for an application, represented with four release levels and its product release type. The four release levels specify the major, minor, tertiary and patch level of a product.
A persistent representation of a product version may be represented by the following columns in a database:
'ProductVersion_type' int(11) DEFAULT NULL,
'ProductVersion_major' smallint(6) NOT NULL,
'ProductVersion_minor' smallint(6) NOT NULL,
'ProductVersion_tertiary' smallint(6) NOT NULL,
'ProductVersion_patchLevel' smallint(6) NOT NULL
ProductReleaseType,
VersionType,
TypeDefinitionRecord.ProductVersion,
Identification.getProductVersion(),
Identification.getRefImplVersion(),
Serialized Form| Nested Class Summary | |
|---|---|
static class |
ProductVersion.XMLHandler
XML parser event handler for converting product version elements into product version values. |
| Field Summary | |
|---|---|
static String |
PRODUCTVERSION_TAG
|
| Constructor Summary | |
|---|---|
ProductVersion(short major,
short minor,
short tertiary,
short patchLevel,
ProductReleaseType type)
Create a product version value that represents the version of an application. |
|
| Method Summary | |
|---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
void |
appendXMLChildren(Node parent,
String alternativeTag)
Additional version of appendXMLChildren(Node) that allows the tag name for the
version number tag to be altered. |
static ProductVersion |
castFromInterface(ProductVersion alien)
Cast a tv.amwa.maj.record.ProductVersion
value from the generic interface to this implementation. |
ProductVersion |
clone()
Creates a cloned deep copy of this embeddable value. |
boolean |
equals(Object o)
Tests to see if the given object is equal to this embeddable value. |
short |
getMajor()
Returns the major component of the version number. |
short |
getMinor()
Returns the minor component of the version number. |
short |
getPatchLevel()
Returns the patch level component of the version number. |
short |
getTertiary()
Returns the tertiary component of the version number. |
ProductReleaseType |
getType()
Returns the associated application's product release type, for example final, debug, beta etc.. |
int |
hashCode()
Returns a hash code value for this embeddable object. |
void |
setMajor(short major)
Sets the major component of this version number. |
void |
setMinor(short minor)
Sets the minor component of the version number. |
void |
setPatchLevel(short patchLevel)
Sets the patch level component of the version number. |
void |
setPropertiesFromInterface(ProductVersion castFrom)
Set the properties of this value from those available in the given value, which is specified by the product version interface. |
void |
setTertiary(short tertiary)
Sets the tertiary component of the version number. |
void |
setType(ProductReleaseType type)
Sets the associated application's product release type, for example final, debug, beta etc.. |
String |
toString()
Creates a pseudo-XML representation of the current value of this product version. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String PRODUCTVERSION_TAG
| Constructor Detail |
|---|
public ProductVersion(@UInt16
short major,
@UInt16
short minor,
@UInt16
short tertiary,
@UInt16
short patchLevel,
ProductReleaseType type)
throws NullPointerException,
IllegalArgumentException
Create a product version value that represents the version of an application.
major - Application's major version number.minor - Application's minor version number.tertiary - Application's tertiary version number.patchLevel - Application's patch level.type - Application's product release type.
NullPointerException - The product release type argument is null.
IllegalArgumentException - One of more of the major, minor, tertiary or patch level
values is negative.| Method Detail |
|---|
public static final ProductVersion castFromInterface(ProductVersion alien)
throws NullPointerException
Cast a tv.amwa.maj.record.ProductVersion
value from the generic interface to this implementation. If the given value is not this
MAJ API implementation, a copy will be instantiated of this type and with an equivalent
value.
alien - A potentially alien implementation of an instance of the product version
interface.
NullPointerException - The given alien value is null.setPropertiesFromInterface(tv.amwa.maj.record.ProductVersion)
public final void setPropertiesFromInterface(ProductVersion castFrom)
throws NullPointerException
Set the properties of this value from those available in the given value, which is specified by the product version interface.
castFrom - Value to extract properties from.
NullPointerException - The given value to use to set this value is null.castFromInterface(tv.amwa.maj.record.ProductVersion)@UInt16 public final short getMajor()
ProductVersionReturns the major component of the version number.
getMajor in interface ProductVersion
public final void setMajor(@UInt16
short major)
throws IllegalArgumentException
ProductVersionSets the major component of this version number.
setMajor in interface ProductVersionmajor - Major component of the version number.
IllegalArgumentException - Cannot set the major component of this product version
to a negative value.@UInt16 public final short getMinor()
ProductVersionReturns the minor component of the version number.
getMinor in interface ProductVersion
public final void setMinor(@UInt16
short minor)
throws IllegalArgumentException
ProductVersionSets the minor component of the version number.
setMinor in interface ProductVersionminor - Minor component of the version number.
IllegalArgumentException - Cannot set the minor component of this product version
to a negative value.@UInt16 public final short getPatchLevel()
ProductVersionReturns the patch level component of the version number.
getPatchLevel in interface ProductVersion
public final void setPatchLevel(@UInt16
short patchLevel)
throws IllegalArgumentException
ProductVersionSets the patch level component of the version number.
setPatchLevel in interface ProductVersionpatchLevel - Patch level component of the version number.
IllegalArgumentException - Cannot set the patch level component of this product version
to a negative value.@UInt16 public final short getTertiary()
ProductVersionReturns the tertiary component of the version number.
getTertiary in interface ProductVersion
public final void setTertiary(@UInt16
short tertiary)
throws IllegalArgumentException
ProductVersionSets the tertiary component of the version number.
setTertiary in interface ProductVersiontertiary - Tertiary component of the version number.
IllegalArgumentException - Cannot set the tertiary component of this product version
to a negative value.public final ProductReleaseType getType()
ProductVersionReturns the associated application's product release type, for example final, debug, beta etc..
getType in interface ProductVersion
public final void setType(ProductReleaseType type)
throws NullPointerException
ProductVersionSets the associated application's product release type, for example final, debug, beta etc..
setType in interface ProductVersiontype - Associated application's release type.
NullPointerException - The given product release type is null.public final boolean equals(Object o)
MAJCommonTests to see if the given object is equal to this embeddable value. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.
equals in interface MAJCommonequals in class Objecto - Object to test for equality with.
Object.equals(Object)public final String toString()
Creates a pseudo-XML representation of the current value of this product version. The value will be formatted in a similar way to the following example:
<ProductVersion>
<major>0</major>
<minor>3</minor>
<tertiary>1</tertiary>
<patchLevel>2</patchLevel>
<type>VersionDebug</type>
</ProductVersion>
toString in interface MAJCommontoString in class ObjectObject.toString()public final ProductVersion clone()
MAJCommonCreates a cloned deep copy of this embeddable value. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.
This method does not throw a CloneNotSupportedException as all
embeddable values must implement the Cloneable interface.
clone in interface MAJCommonclone in class ObjectObject.clone()public final int hashCode()
MAJCommonReturns a hash code value for this embeddable object.
hashCode in interface MAJCommonhashCode in class ObjectObject.hashCode()public final void appendXMLChildren(Node parent)
XMLSerializableAppend child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableparent - XML parent element to append child nodes to.
public final void appendXMLChildren(Node parent,
String alternativeTag)
Additional version of appendXMLChildren(Node) that allows the tag name for the
version number tag to be altered.
parent - Parent node to append this product version to as an XML child.alternativeTag - Name of the tag to use to represent the product version.
|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||