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

tv.amwa.maj.model

## Interface ConstantValue

- All Superinterfaces:
    InterchangeObject, MediaEntity, MetadataObject, Parameter
  All Known Implementing Classes:
    ConstantValueImpl

      public interface ConstantValue
      extends Parameter

  Specifies a 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.

  The value property of a constant value is specified to be of indirect type, which the MAJ API represents as a Java object. This value should be convertible to an AAF property value using `TypeDefinition.createValue(Object)` for the type specified for this parameter.

  See Also:
    `ParameterDefinition`, `TypeDefinitionIndirect`, `PropertyValue`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ConstantValue` | `clone()` Create a cloned copy of this constant value.
    `TypeDefinition` | `getTypeDefinition()` Returns the type definition associated with this constant value, which is the same as the type definition for the parameter definition of this parameter.
    `PropertyValue` | `getValue()` Returns the value of this constant value object, which is a property value that contains the type and current value.
    `void` | `setValue(PropertyValue value)` Set the value of this constant value.

    - ### 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`

- - ### Method Detail

    - #### getValue

          PropertyValue getValue()

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

      Returns:
        Property value of this constant value.
      See Also:
        `PropertyValue.getValue()`, `PropertyValue.getType()`

    - #### getTypeDefinition

          TypeDefinition getTypeDefinition()

      Returns the type definition associated with this constant value, which is the same as the type definition for the parameter definition of this parameter.

      Specified by:
        `getTypeDefinition` in interface `Parameter`
      Returns:
        Type definition of the data value inside of this object.
      See Also:
        `Parameter.getTypeDefinition()`, `ParameterDefinition.getParameterType()`

    - #### setValue

          void setValue(PropertyValue value)
                 throws NullPointerException,
                        ClassCastException

      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 `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);

      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)`

    - #### clone

          ConstantValue clone()

      Create a cloned copy of this constant value.

      Specified by:
        `clone` in interface `InterchangeObject`
      Specified by:
        `clone` in interface `MediaEntity`
      Specified by:
        `clone` in interface `Parameter`
      Returns:
        Cloned copy of this constant value.

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