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

tv.amwa.maj.model.impl

## Class ConstantValueImpl

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

- All Implemented Interfaces:
    Serializable, Cloneable, MediaEntity, MetadataObject, XMLSerializable, ConstantValue, InterchangeObject, Parameter

      @MediaClass(uuid1=218169601,
                  uuid2=257,
                  uuid3=15616,
                  uuid4={6,14,43,52,2,6,1,1},
                  definedName="ConstantValue",
                  description="The ConstantValue class specifies a constant data value for an effect control value.",
                  symbol="ConstantValue")
      public class ConstantValueImpl
      extends ParameterImpl
      implements ConstantValue, Serializable, XMLSerializable, Cloneable

  Implements a constant data value for an effect control value. Use varying values and one or more control points for parameters which change in value during the operation group.

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `ObjectClassPropertyID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConstantValueImpl()` Default constructor is not public to avoid unset required fields.
    `ConstantValueImpl(ParameterDefinition parameterDefinition, Object value)` Creates and initializes a new constant value object that is identified with the given parameter definition and the value of the constant.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConstantValue` | `clone()` Create a cloned copy of this interchange object.
    `PropertyValue` | `getValue()` Returns the value of this constant value object, which is a property value that contains the type and current value.
    `byte[]` | `getValuePersist()`
    `static PropertyValue` | `initializeValue()`
    `void` | `setValue(PropertyValue value)` Set the value of this constant value.
    `void` | `setValuePersist(byte[] value)`

    - ### Methods inherited from class tv.amwa.maj.model.impl.ParameterImpl

      `getComment, getParameterDefinition, getParameterDefinitionReference, getParameterDefinitionReferenceString, getTypeDefinition, initializeParameterDefinitionReference, setParameterDefinition, setParameterDefinitionReference, setParameterDefinitionReferenceFromStream, setParameterDefinitionReferenceString`

    - ### Methods inherited from class tv.amwa.maj.model.impl.InterchangeObjectImpl

      `addApplicationPlugin, appendXMLChildren, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getLinkedGenerationIDString, getObjectClass, getPersistentID, getPersistentIndex, hashCode, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setLinkedGenerationIDString, setObjectClass, setPersistentID, setPersistentIndex, toString`

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

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

    - ### Methods inherited from interface tv.amwa.maj.model.ConstantValue

      `getTypeDefinition`

    - ### Methods inherited from interface tv.amwa.maj.model.Parameter

      `getParameterDefinition, getParameterDefinitionReference`

    - ### Methods inherited from interface tv.amwa.maj.model.InterchangeObject

      `addApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toString`

    - ### Methods inherited from interface tv.amwa.maj.industry.MediaEntity

      `getPersistentID, setPersistentIndex`

    - ### Methods inherited from interface tv.amwa.maj.io.xml.XMLSerializable

      `appendXMLChildren, getComment`

- - ### Constructor Detail

    - #### ConstantValueImpl

          public ConstantValueImpl()

      Default constructor is not public to avoid unset required fields.

    - #### ConstantValueImpl

          public ConstantValueImpl(ParameterDefinition parameterDefinition,
                                   Object value)
                            throws NullPointerException,
                                   ClassCastException

      Creates and initializes a new constant value object that is identified with the given parameter definition and the value of the constant.

      Note that a data type may allow the value of a property to be `null`.

      Parameters:
        `parameterDefinition` - Parameter definition for this object. This determines the type of the constant value.
        `value` - Buffer containing the constant's value.
      Throws:
        `NullPointerException` - The parameter definition is `null`.
        `ClassCastException` - The given value cannot be converted to a value compatible with the type definition of the parameter.

  - ### Method Detail

    - #### getValue

          @MediaProperty(uuid1=87033095,
                         uuid2=0,
                         uuid3=0,
                         uuid4={6,14,43,52,1,1,1,2},
                         definedName="Value",
                         aliases="ConstantValueValue",
                         typeName="Indirect",
                         optional=false,
                         uniqueIdentifier=false,
                         pid=19713,
                         symbol="Value")
          public PropertyValue getValue()

      Description copied from interface: `ConstantValue`

      Returns the value of this constant value object, which is a property value that contains the type and current value.

      Specified by:
        `getValue` in interface `ConstantValue`
      Returns:
        Property value of this constant value.
      See Also:
        `PropertyValue.getValue()`, `PropertyValue.getType()`

    - #### setValue

          @MediaPropertySetter(value="Value")
          public void setValue(PropertyValue value)
                                                            throws NullPointerException,
                                                                   ClassCastException

      Description copied from interface: `ConstantValue`

      Set the value of this constant value.

      To create a property value of a specific type, use the `createValue()` method of a `type definition`. To access a type definition, use the `ConstantValue.getTypeDefinition()` method as follows:

                constantValue.setValue(
                    constantValue.getTypeDefinition().createValue(42));

      Alternatively, you can retrieve the value of any other property using its property definition. To retrieve the property value of a property called foo from an instance called bar:

                ClassDefinition barClassDef =
                    ClassDefinitionWarehouse.forClass(bar.getClass());
                PropertyDefinition fooDefinition =
                    barClassDef.lookupPropertyDefinition("foo");
                PropertyValue fooValue =
                   fooDefinition.getPropertyValue(bar);

      Specified by:
        `setValue` in interface `ConstantValue`
      Parameters:
        `value` - Value and type to of this constant value.
      Throws:
        `NullPointerException` - The given value is `null`.
        `ClassCastException`
      See Also:
        `TypeDefinition.createValue(Object)`, `PropertyValue.getValue()`, `Warehouse.lookForType(String)`

    - #### initializeValue

          public static final PropertyValue initializeValue()

    - #### clone

          public ConstantValue 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 `ConstantValue`
      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `Parameter`
      Overrides:
        `clone` in class `ParameterImpl`
      Returns:
        Cloned copy of this interchange object.

    - #### getValuePersist

          public byte[] getValuePersist()
                                 throws NullPointerException,
                                        IllegalPropertyValueException,
                                        InsufficientSpaceException

      Throws:
        `NullPointerException`
        `IllegalPropertyValueException`
        `InsufficientSpaceException`

    - #### setValuePersist

          public void setValuePersist(byte[] value)

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