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

tv.amwa.maj.model.impl

## Class InterchangeObjectImpl

- java.lang.Object
- - tv.amwa.maj.model.impl.InterchangeObjectImpl

- All Implemented Interfaces:
    Serializable, Cloneable, MediaEntity, MetadataObject, InterchangeObject
  Direct Known Subclasses:
    ApplicationObjectImpl, Avid_MC_Mob_ReferenceImpl, ComponentImpl, ContentStorageImpl, ControlPointImpl, DefinitionObjectImpl, DescriptiveFrameworkImpl, DescriptiveObjectImpl, DictionaryImpl, EssenceDataImpl, EssenceDescriptorImpl, IdentificationImpl, KLVDataImpl, LocatorImpl, PackageImpl, PackageMarkerImpl, ParameterImpl, PrefaceImpl, RIFFChunkImpl, SubDescriptorImpl, TaggedValueImpl, TrackImpl

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=256,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="InterchangeObject",
                  description="The InterchangeObject class is a root class. All classes defined in an AAF file shall be sub-classes of InterchangeObject with the exception of the MetaDefinition classes defined by this document.",
                  symbol="InterchangeObject",
                  namespace="http://www.smpte-ra.org/schemas/2001-2/2007/aaf",
                  prefix="aaf",
                  aliases="AAFObject",
                  isConcrete=false)
      public class InterchangeObjectImpl
      extends Object
      implements InterchangeObject, Serializable, Cloneable

  Implements the root class for all AAF persistent classes. All classes defined in an AAF file shall be sub-classes of interchange object with the exception of the meta definition classes.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static AUID` | `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InterchangeObjectImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addApplicationPlugin(ApplicationPluginObject applicationPlugin)` Add an application metadata plugin so as to this object to enhance its application-specific description.
    `void` | `appendXMLChildren(Node parent)`
    `void` | `clearApplicationPlugins()` Clear the set of application metadata plugins, omitting the optional property.
    `InterchangeObject` | `clone()` Create a cloned copy of this interchange object.
    `boolean` | `containsApplicationPlugin(ApplicationPluginObject applicationPlugin)` Determines whether the given application metadata plugin instance is attached to this interchange object.
    `boolean` | `containsApplicationPlugin(AUID applicationPluginInstanceID)` Determines whether the given identifier for a application metadata plugin instance is attached to this interchange object.
    `int` | `countApplicationPlugins()` Returns the number of application metadata plugins attached to this interchange object.
    `boolean` | `deepEquals(Object o)` Tests if this interchangeable object is equal to the given object by comparing every property and the properties of any referenced values.
    `void` | `disableGenerationTracking()` Calling this method will cause generation tracking to be disabled for the object.
    `void` | `enableGenerationTracking()` Calling this method will cause generation tracking to be enabled for the object.
    `boolean` | `equals(Object o)` Tests if this interchangeable object is equal to the given object by comparing unique identifiers where available, or property-by-property if not.
    `Set<ApplicationPluginObject>` | `getApplicationPlugins()` Returns the set of application metadata plugins attached to this interchange object, where each attached object contains application-specific description.
    `String` | `getComment()`
    `Identification` | `getGeneration()` Gets the generation of this object, which identifies when this object was created or last modified.
    `AUID` | `getLinkedGenerationID()` Shortcut to get the AUID of the identification representing this object's generation.
    `String` | `getLinkedGenerationIDString()`
    `ClassDefinition` | `getObjectClass()` Returns the class definition that identifies the class of this interchange object.
    `Long` | `getPersistentID()` Returns the persistent identifier for this media entity.
    `int` | `getPersistentIndex()`
    `int` | `hashCode()`
    `boolean` | `isGenerationTracked()` Returns `true` if generations are being tracked by the object.
    `boolean` | `removeApplicationPlugin(ApplicationPluginObject applicationPlugin)` Remove the given application metadata plugin from the set of application plugins attached to this interchange object.
    `boolean` | `removeApplicationPlugin(AUID applicationPluginInstanceID)` Remove the application metadata plugin with the given identifier from the set of application plugins attached to this interchange object.
    `void` | `setLinkedGenerationID(AUID linkedGenerationID)` Sets the linked generation identification for this object that represents this object's generation.
    `void` | `setLinkedGenerationIDString(String linkedGenerationID)`
    `void` | `setObjectClass(ClassDefinition objectClass)` Sets the class definition that identifies the class of this interchange object.
    `void` | `setPersistentID(Long persistentID)`
    `void` | `setPersistentIndex(int index)` If the media entity is an element of a strong reference vector, set the index of that element in the vector just before the value is persisted.
    `String` | `toString()` Provides an XML representation of this value.

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ObjectClassPropertyID

          public static final AUID ObjectClassPropertyID

  - ### Constructor Detail

    - #### InterchangeObjectImpl

          public InterchangeObjectImpl()

  - ### Method Detail

    - #### disableGenerationTracking

          public void disableGenerationTracking()

      Description copied from interface: `InterchangeObject`

      Calling this method will cause generation tracking to be disabled for the object. Generation information will then not be available through the `InterchangeObject.getGeneration()` and `InterchangeObject.getLinkedGenerationID()` methods.

      Calling the `InterchangeObject.enableGenerationTracking()` method will enable generation tracking for this object.

      Generation tracking is disabled by default.

      Specified by:
        `disableGenerationTracking` in interface `InterchangeObject`

    - #### enableGenerationTracking

          public void enableGenerationTracking()

      Description copied from interface: `InterchangeObject`

      Calling this method will cause generation tracking to be enabled for the object. Generation information will then be available through the `InterchangeObject.getGeneration()` and `InterchangeObject.getLinkedGenerationID()` methods.

      Calling the `InterchangeObject.disableGenerationTracking()` method will disable generation tracking for this object.

      Generation tracking is disabled by default.

      Specified by:
        `enableGenerationTracking` in interface `InterchangeObject`

    - #### getObjectClass

          @MediaProperty(uuid1=100729092,
                         uuid2=257,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="ObjectClass",
                         aliases="ObjClass",
                         typeName="ClassDefinitionWeakReference",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=257,
                         symbol="ObjectClass")
          public ClassDefinition getObjectClass()

      Description copied from interface: `InterchangeObject`

      Returns the class definition that identifies the class of this interchange object.

      Specified by:
        `getObjectClass` in interface `InterchangeObject`
      Returns:
        Class definition that describes this object instance.
      See Also:
        `MediaEngine.getClassDefinition(tv.amwa.maj.industry.MetadataObject)`, `TypeDefinitions.ClassDefinitionWeakReference`

    - #### setObjectClass

          @MediaPropertySetter(value="ObjectClass")
          public void setObjectClass(ClassDefinition objectClass)

      Description copied from interface: `InterchangeObject`

      Sets the class definition that identifies the class of this interchange object.

      Setting this property used by application metadata plugins to indicate the defined class of an extension to this class. In this case, the base class property can be used to hold the identifier of this class.

      Specified by:
        `setObjectClass` in interface `InterchangeObject`
      Parameters:
        `objectClass` - Class definition that describes this object instance.
      See Also:
        `ExtensionScheme.getMetaDefinitions()`, `ApplicationObject.getBaseClass()`

    - #### getGeneration

          public Identification getGeneration()
                                       throws InvalidParameterException,
                                              ObjectNotAttachedException

      Description copied from interface: `InterchangeObject`

      Gets the generation of this object, which identifies when this object was created or last modified.

      This method will succeed if generation tracking is enabled for this object. Call `InterchangeObject.enableGenerationTracking()` and `InterchangeObject.disableGenerationTracking()` to control generation tracking for this object. Call `InterchangeObject.isGenerationTracked()` to determine if generation tracking is currently enabled for this object.

      Specified by:
        `getGeneration` in interface `InterchangeObject`
      Returns:
        Identification for when this object was last modified.
      Throws:
        `InvalidParameterException` - Generation tracking is not enabled for this object.
        `ObjectNotAttachedException` - This object is not attached to a file from which generation information can be obtained.

    - #### getLinkedGenerationID

          @MediaProperty(uuid1=85985025,
                         uuid2=2048,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="LinkedGenerationID",
                         aliases="Generation",
                         typeName="AUID",
                         optional=true,
                         uniqueIdentifier=false,
                         pid=258,
                         symbol="LinkedGenerationID")
          public AUID getLinkedGenerationID()
                                                                                                                                                                                                                                                                                                                                                                                                                                 throws PropertyNotPresentException,
                                                                                                                                                                                                                                                                                                                                                                                                                                        ObjectNotAttachedException

      Description copied from interface: `InterchangeObject`

      Shortcut to get the AUID of the identification representing this object's generation.

      This method will succeed if generation tracking is enabled for this object. Call `InterchangeObject.enableGenerationTracking()` and `InterchangeObject.disableGenerationTracking()` to control generation tracking for this object. Call `InterchangeObject.isGenerationTracked()` to determine if generation tracking is currently enabled for this object.

      Specified by:
        `getLinkedGenerationID` in interface `InterchangeObject`
      Returns:
        AUID of the identification representing this object's generation.
      Throws:
        `ObjectNotAttachedException` - This object is not attached to a file from which generation information can be obtained.
        `PropertyNotPresentException`
      See Also:
        `InterchangeObject.getGeneration()`, `InterchangeObject.getLinkedGenerationID()`

    - #### setLinkedGenerationID

          @MediaPropertySetter(value="LinkedGenerationID")
          public void setLinkedGenerationID(AUID linkedGenerationID)

      Description copied from interface: `InterchangeObject`

      Sets the linked generation identification for this object that represents this object's generation. In a file, all objects added or modified at the same time have the same generation identification and that generation is described by an identification.

      Passing a `null` value into to this method will omit the linked generation property and disable generation tracking. Passing in a nil value will indicate that this object is not attached to a file where its identification can be resolved. Passing in a non-nil value will enable generation tracking and a means to resolve the identification should be provided.

      Specified by:
        `setLinkedGenerationID` in interface `InterchangeObject`
      Parameters:
        `linkedGenerationID` - Linked generation identification for this interchangeable object.
      See Also:
        `InterchangeObject.getLinkedGenerationID()`, `InterchangeObject.getGeneration()`, `InterchangeObject.getLinkedGenerationID()`, `Preface.getIdentifications()`

    - #### isGenerationTracked

          public boolean isGenerationTracked()

      Description copied from interface: `InterchangeObject`

      Returns `true` if generations are being tracked by the object. A value of `true` indicates that generation information will be available through the `InterchangeObject.getGeneration()` and `InterchangeObject.getLinkedGenerationID()` methods.

      Calling the `InterchangeObject.enableGenerationTracking()` method will enable generation tracking for this object; calling the `InterchangeObject.disableGenerationTracking()` method will disable generation tracking for this object.

      Generation tracking is disabled by default.

      Specified by:
        `isGenerationTracked` in interface `InterchangeObject`
      See Also:
        `InterchangeObject.enableGenerationTracking()`, `InterchangeObject.disableGenerationTracking()`

    - #### getApplicationPlugins

          @MediaProperty(uuid1=100729092,
                         uuid2=526,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,12},
                         definedName="ApplicationPlugins",
                         aliases={"ApplicationPlugIns","ApplicationPlug-InBatch","ApplicationPlug-In Batch"},
                         typeName="ApplicationPluginObjectStrongReferenceSet",
                         pid=0,
                         symbol="ApplicationPlugins",
                         optional=true,
                         uniqueIdentifier=false,
                         description="Set of application metadata plugins attached to this interchange object, where each attached object contains application-specific description.")
          public Set<ApplicationPluginObject> getApplicationPlugins()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         throws PropertyNotPresentException

      Description copied from interface: `InterchangeObject`

      Returns the set of application metadata plugins attached to this interchange object, where each attached object contains application-specific description. This is an optional property.

      Specified by:
        `getApplicationPlugins` in interface `InterchangeObject`
      Returns:
        Set of application metadata plugins attached to this object.
      Throws:
        `PropertyNotPresentException` - The optional application plugins extension is not present for this interchange object.
      See Also:
        `Root.getRootExtensions()`, `ApplicationPluginObject.getApplicationScheme()`

    - #### addApplicationPlugin

          @MediaSetAdd(value="ApplicationPlugins")
          public void addApplicationPlugin(ApplicationPluginObject applicationPlugin)
                                                                             throws NullPointerException

      Description copied from interface: `InterchangeObject`

      Add an application metadata plugin so as to this object to enhance its application-specific description.

      Specified by:
        `addApplicationPlugin` in interface `InterchangeObject`
      Parameters:
        `applicationPlugin` - Application plugin object to add to the set of application plugins.
      Throws:
        `NullPointerException` - Cannot add a `null` application plugin object to the set of plugins.
      See Also:
        `InterchangeObject.getApplicationPlugins()`

    - #### containsApplicationPlugin

          @MediaPropertyContains(value="ApplicationPlugins")
          public boolean containsApplicationPlugin(ApplicationPluginObject applicationPlugin)
                                                                                               throws NullPointerException

      Description copied from interface: `InterchangeObject`

      Determines whether the given application metadata plugin instance is attached to this interchange object.

      Specified by:
        `containsApplicationPlugin` in interface `InterchangeObject`
      Parameters:
        `applicationPlugin` - Application plugin object to check for.
      Returns:
        Is the given application plugin object attached to this interchange object?
      Throws:
        `NullPointerException` - Cannot check for attachment using a `null` value.
      See Also:
        `InterchangeObject.containsApplicationPlugin(AUID)`, `InterchangeObject.getApplicationPlugins()`

    - #### containsApplicationPlugin

          public boolean containsApplicationPlugin(AUID applicationPluginInstanceID)
                                            throws NullPointerException

      Description copied from interface: `InterchangeObject`

      Determines whether the given identifier for a application metadata plugin instance is attached to this interchange object.

      Specified by:
        `containsApplicationPlugin` in interface `InterchangeObject`
      Parameters:
        `applicationPluginInstanceID` - Identifier for the application plugin object to check for.
      Returns:
        Is the given identifier for an application plugin object attached to this interchange object?
      Throws:
        `NullPointerException` - Cannot check for attachment using a `null` value for an identifier.
      See Also:
        `InterchangeObject.containsApplicationPlugin(ApplicationPluginObject)`, `InterchangeObject.getApplicationPlugins()`

    - #### clearApplicationPlugins

          @MediaPropertyClear(value="ApplicationPlugins")
          public void clearApplicationPlugins()

      Description copied from interface: `InterchangeObject`

      Clear the set of application metadata plugins, omitting the optional property.

      Specified by:
        `clearApplicationPlugins` in interface `InterchangeObject`
      See Also:
        `InterchangeObject.getApplicationPlugins()`

    - #### countApplicationPlugins

          @MediaPropertyCount(value="ApplicationPlugins")
          public int countApplicationPlugins()

      Description copied from interface: `InterchangeObject`

      Returns the number of application metadata plugins attached to this interchange object.

      Specified by:
        `countApplicationPlugins` in interface `InterchangeObject`
      Returns:
        Number of application metadata plugins attached to this object.
      See Also:
        `InterchangeObject.getApplicationPlugins()`

    - #### removeApplicationPlugin

          @MediaPropertyRemove(value="ApplicationPlugins")
          public boolean removeApplicationPlugin(ApplicationPluginObject applicationPlugin)
                                                                                           throws NullPointerException

      Description copied from interface: `InterchangeObject`

      Remove the given application metadata plugin from the set of application plugins attached to this interchange object.

      Specified by:
        `removeApplicationPlugin` in interface `InterchangeObject`
      Parameters:
        `applicationPlugin` - Application plugin object to remove.
      Returns:
        Was the application plugin object removed successfully? A value of `false` is returned if the plugin object was not already attached.
      Throws:
        `NullPointerException` - Cannot remove an application metadata plugin object using a `null` value.
      See Also:
        `InterchangeObject.getApplicationPlugins()`

    - #### removeApplicationPlugin

          public boolean removeApplicationPlugin(AUID applicationPluginInstanceID)
                                          throws NullPointerException

      Description copied from interface: `InterchangeObject`

      Remove the application metadata plugin with the given identifier from the set of application plugins attached to this interchange object.

      Specified by:
        `removeApplicationPlugin` in interface `InterchangeObject`
      Parameters:
        `applicationPluginInstanceID` - Identifier of this application plugin object to remove.
      Returns:
        Was the application plugin object removed successfully? A value of `false` is returned if the plugin object was not already attached.
      Throws:
        `NullPointerException` - Cannot remove an application metadata plugin object using a `null` identifier.
      See Also:
        `InterchangeObject.getApplicationPlugins()`

    - #### toString

          public final String toString()

      Description copied from interface: `InterchangeObject`

      Provides an XML representation of this value. This value is useful for debugging and understanding the internal structure of an item of media.

      Note that this interface does not guarantee to provide valid XML. Use `XMLBuilder.toXML(tv.amwa.maj.industry.MetadataObject)` for this.

      Specified by:
        `toString` in interface `InterchangeObject`
      Overrides:
        `toString` in class `Object`
      Returns:
        An XML representation of the value of this interchange object.
      See Also:
        `XMLBuilder.toXML(tv.amwa.maj.industry.MetadataObject)`, `MediaEngine.toString(tv.amwa.maj.industry.MetadataObject)`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Description copied from interface: `InterchangeObject`

      Tests if this interchangeable object is equal to the given object by comparing unique identifiers where available, or property-by-property if not. Two objects are equal if and only if the following conditions are all met:

      - the given object is not `null`;
      - they are the same object;
      - they are of the same type;
      - Either:
        - they have the same unique identifier, or
        - the following conditions are met:
          - they have the same properties omitted or present;
          - the value of each property non-reference or collection property is the same using `Object.equals(Object)`;
          - an array-type property contains the same number of values and an equals comparison of each element, index-for-index, is the same;
          - a set-type property contains the same number of values and the same elements, determined by an equals comparison;
          - a referenced property is the same according to an equals comparison.

      For a property-by-property comparison of each value, use `InterchangeObject.deepEquals(Object)`.

      Specified by:
        `equals` in interface `InterchangeObject`
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - Object to test equality with this one.
      Returns:
        Do this object and the given object represent the same value?
      See Also:
        `InterchangeObject.deepEquals(Object)`, `MediaEngine.equals(tv.amwa.maj.industry.MetadataObject, Object)`, `Object.equals(Object)`

    - #### deepEquals

          public boolean deepEquals(Object o)

      Description copied from interface: `InterchangeObject`

      Tests if this interchangeable object is equal to the given object by comparing every property and the properties of any referenced values. Two objects are equal if and only if the following conditions are all met:

      - the given object is not `null`;
      - they are the same object;
      - they are of the same type;
      - they have the same properties omitted or present;
      - the value of each property non-reference or collection property is the same;
      - an array-type property contains the same number of values and a deep equals comparison of each element, index-for-index, is the same;
      - a set-type property contains the same number of values and the same elements, determined by a deep equals comparison;
      - a referenced property is the same according to a deep equals comparison.

      The main difference between this method and `InterchangeObject.equals(Object)` is that this method compares every property, even when a unique identifier is provided.

      Specified by:
        `deepEquals` in interface `InterchangeObject`
      Parameters:
        `o` - Object to test deep equality with this one.
      Returns:
        Do this object and the given object represent the same value?
      See Also:
        `InterchangeObject.equals(Object)`, `MediaEngine.deepEquals(tv.amwa.maj.industry.MetadataObject, Object)`

    - #### clone

          public InterchangeObject clone()

      Description copied from interface: `InterchangeObject`

      Create a cloned copy of this interchange object.

      Specified by:
        `clone` in interface `MediaEntity`
      Specified by:
        `clone` in interface `InterchangeObject`
      Overrides:
        `clone` in class `Object`
      Returns:
        Cloned copy of this interchange object.

    - #### appendXMLChildren

          public void appendXMLChildren(Node parent)

    - #### getComment

          public String getComment()

    - #### getPersistentID

          public Long getPersistentID()

      Description copied from interface: `MediaEntity`

      Returns the persistent identifier for this media entity. This will be automatically generated by the persistence provider when the object is persisted for the first time. Before this, the identifier will be null.

      Specified by:
        `getPersistentID` in interface `MediaEntity`
      Returns:
        Persistent identifier for this media entity.

    - #### setPersistentID

          public void setPersistentID(Long persistentID)

    - #### getPersistentIndex

          public int getPersistentIndex()

    - #### setPersistentIndex

          public void setPersistentIndex(int index)

      Description copied from interface: `MediaEntity`

      If the media entity is an element of a strong reference vector, set the index of that element in the vector just before the value is persisted. When the value is retrieved, the index will be used to restore the item to the correct position in its list. This is required to overcome a shortcoming of the Java Persistence API when persisting ordered collections.

      Specified by:
        `setPersistentIndex` in interface `MediaEntity`
      Parameters:
        `index` - Index of the entity within the list that contains it.

    - #### getLinkedGenerationIDString

          public String getLinkedGenerationIDString()

    - #### setLinkedGenerationIDString

          public void setLinkedGenerationIDString(String linkedGenerationID)

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