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

tv.amwa.maj.industry

## Interface PropertyValue

- All Known Implementing Classes:
    TypeDefinitionCharacterImpl.CharacterValue, TypeDefinitionEnumerationImpl.EnumerationValue, TypeDefinitionExtendibleEnumerationImpl.ExtendibleEnumerationValue, TypeDefinitionFixedArrayImpl.FixedArrayValue, TypeDefinitionImpl.PropertyValueImpl, TypeDefinitionIndirectImpl.IndirectValue, TypeDefinitionIntegerImpl.BaseIntegerValue, TypeDefinitionIntegerImpl.ByteValue, TypeDefinitionIntegerImpl.IntegerValue, TypeDefinitionIntegerImpl.LongValue, TypeDefinitionIntegerImpl.ShortValue, TypeDefinitionObjectReferenceImpl.ObjectReferenceValue, TypeDefinitionObjectReferenceImpl.UnresolvedReferenceValue, TypeDefinitionOpaqueImpl.OpaqueValue, TypeDefinitionRecordImpl.RecordValue, TypeDefinitionRenameImpl.RenamedValue, TypeDefinitionSetImpl.SetValue, TypeDefinitionStreamImpl.StreamValue, TypeDefinitionStringImpl.BaseStringValue, TypeDefinitionStringImpl.ByteArrayStringValue, TypeDefinitionStringImpl.CharacterStringValue, TypeDefinitionVariableArrayImpl.VariableArrayValue

      public interface PropertyValue

  Specifies the type and current value of a property. Methods of the subclasses of type definition allow access to the data value held in the property value object.

  See Also:
    `TypeDefinition.createValue(Object)`, `PropertyDefinition`, `getValue()`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)` Tests to see if the this property value and the given object are equal.
    `TypeDefinition` | `getType()` Returns the type definition for this property value.
    `Object` | `getValue()` Returns the value of the property through a generic Java object interface.
    `int` | `hashCode()` Computes a hash code for this property value, based on type and value.
    `String` | `toString()` Creates a string representation of the value contained in this property value.

- - ### Method Detail

    - #### getType

          TypeDefinition getType()

      Returns the type definition for this property value.

      Methods of the returned type definition can be used to manipulate a property value. For example, for a value of AAF `UInt32` type, the following methods are available on `TypeDefinitionInteger`:

      - `Number getInteger(PropertyValue)`
      - `PropertyValue createValueFromNumber(Number)`
      - `void setInteger(PropertyValue, Number)`
      Returns:
        Type of this property value.
      See Also:
        `PropertyDefinition.getTypeDefinition()`, `TypeDefinitions.TypeDefinitionWeakReference`

    - #### getValue

          Object getValue()

      Returns the value of the property through a generic Java object interface. Alternative type-specific access methods are provided in each type definition.

      For example, for a property value of a `UInt32` type, this method returns an `Integer`. Values will need to be cast to appropriate types by the application. The value returned may be `null`, which may indicate that an optional property was not present.

      Returns:
        Value of this property.
      See Also:
        `TypeDefinition.createValue(Object)`

    - #### equals

          boolean equals(Object o)

      Tests to see if the this property value and the given object are equal. Two property values are equal if-and-only-if:

      - the given object is not `null`;
      - the given object is another property value;
      - the given property value has the same type as this one;
      - the values of the given property and this one are equal according to `Object.equals(Object)` or both property values represent a `null` value.
      Overrides:
        `equals` in class `Object`
      Parameters:
        `o` - Property value to test equality with this one.
      Returns:
        Is this property value equal to the given property value.
      See Also:
        `Object.equals(Object)`, `MediaEngine.deepEquals(MetadataObject, Object)`

    - #### hashCode

          int hashCode()

      Computes a hash code for this property value, based on type and value. This method follows the Java hash code rules.

      Overrides:
        `hashCode` in class `Object`
      Returns:
        Hashcode computed for this property value.
      See Also:
        `MediaEngine.hashCode(MetadataObject)`

    - #### toString

          String toString()

      Creates a string representation of the value contained in this property value. The string "null" is returned for a `null` value. The type of the value is not included.

      Overrides:
        `toString` in class `Object`
      Returns:
        String representation of the value contained in this property value.
      See Also:
        `MediaEngine.toString(MetadataObject)`

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