ProductVersion (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.record

## Interface ProductVersion

- All Known Implementing Classes:
    ProductVersionImpl

      public interface ProductVersion

  Specifies the version number of 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.

  To make values of this type, use the following methods from the MAJ forge:

  - From its constituent parts: `Forge.makeProductVersion(short, short, short, short, ProductReleaseType)`;
  - A zero default value: `Forge.zeroProductVersion()`;
  - From a pseudo-XML string representation as generated by `toString()`: `Forge.parseProductVersion(String)`.
  See Also:
    `TypeDefinitions.ProductVersionType`, `VersionType`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ProductVersion` | `clone()` Create a cloned copy of this product version.
    `ProductReleaseType` | `getBuildType()` Returns the associated application's product release type, for example final, debug, beta etc..
    `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.
    `void` | `setBuildType(ProductReleaseType type)` Sets the associated application's product release type, for example final, debug, beta etc..
    `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` | `setTertiary(short tertiary)` Sets the tertiary component of the version number.
    `String` | `toString()` Formats a pseudo-XML representation of the current value of this product version.

- - ### Method Detail

    - #### getMajor

          @UInt16
          short getMajor()

      Returns the major component of the version number.

      Returns:
        Major component of the version number.

    - #### setMajor

          void setMajor(@UInt16
                        short major)
                 throws IllegalArgumentException

      Sets the major component of this version number.

      Parameters:
        `major` - Major component of the version number.
      Throws:
        `IllegalArgumentException` - Cannot set the major component of this product version to a negative value.

    - #### getMinor

          @UInt16
          short getMinor()

      Returns the minor component of the version number.

      Returns:
        Minor component of the version number.

    - #### setMinor

          void setMinor(@UInt16
                        short minor)
                 throws IllegalArgumentException

      Sets the minor component of the version number.

      Parameters:
        `minor` - Minor component of the version number.
      Throws:
        `IllegalArgumentException` - Cannot set the minor component of this product version to a negative value.

    - #### getTertiary

          @UInt16
          short getTertiary()

      Returns the tertiary component of the version number.

      Returns:
        Tertiary component of the version number.

    - #### setTertiary

          void setTertiary(@UInt16
                           short tertiary)
                    throws IllegalArgumentException

      Sets the tertiary component of the version number.

      Parameters:
        `tertiary` - Tertiary component of the version number.
      Throws:
        `IllegalArgumentException` - Cannot set the tertiary component of this product version to a negative value.

    - #### getPatchLevel

          @UInt16
          short getPatchLevel()

      Returns the patch level component of the version number.

      Returns:
        Patch level component of the version number.

    - #### setPatchLevel

          void setPatchLevel(@UInt16
                             short patchLevel)
                      throws IllegalArgumentException

      Sets the patch level component of the version number.

      Parameters:
        `patchLevel` - Patch level component of the version number.
      Throws:
        `IllegalArgumentException` - Cannot set the patch level component of this product version to a negative value.

    - #### getBuildType

          ProductReleaseType getBuildType()

      Returns the associated application's product release type, for example final, debug, beta etc..

      Returns:
        Associated application's release type.

    - #### setBuildType

          void setBuildType(ProductReleaseType type)
                     throws NullPointerException

      Sets the associated application's product release type, for example final, debug, beta etc..

      Parameters:
        `type` - Associated application's release type.
      Throws:
        `NullPointerException` - The given product release type is `null`.

    - #### clone

          ProductVersion clone()

      Create a cloned copy of this product version.

      Returns:
        Cloned copy of this product version.

    - #### toString

          String toString()

      Formats 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>
                 <BuildType>VersionDebug</BuildType>
               </ProductVersion>

      Overrides:
        `toString` in class `Object`
      Returns:
        Pseudo-XML representation of this product version.

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.