com.adobe.mediacore.metadata
Class MetadataNode

java.lang.Object
  extended by com.adobe.mediacore.metadata.MetadataNode
All Implemented Interfaces:
Metadata, Serializable

public class MetadataNode
extends Object
implements Metadata, Serializable

See Also:
Serialized Form

Constructor Summary
MetadataNode()
           
 
Method Summary
 boolean containsKey(String key)
          Checks if the metadata contains the specified key.
 boolean containsNode(String key)
           
static Metadata fromByteArray(byte[] bytes)
          Parse the array into a Metadata object.
 MetadataNode getNode(String key)
           
 String getValue(String key)
          Returns the value associated with the specified key as string.
 boolean isEmpty()
          Checks if the metadata has any mapping defined.
 Set<String> keySet()
          Returns a Set containing the strings used as keys in this metadata.
 void setNode(String key, Metadata value)
           
 void setValue(String key, String value)
          Stores a String value into this metadata, replacing any existing value for the given key.
 byte[] toByteArray()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataNode

public MetadataNode()
Method Detail

containsKey

public final boolean containsKey(String key)
Description copied from interface: Metadata
Checks if the metadata contains the specified key.

Specified by:
containsKey in interface Metadata
Parameters:
key - the key to be looked for
Returns:
true if the key is found, false otherwise.

getValue

public final String getValue(String key)
Description copied from interface: Metadata
Returns the value associated with the specified key as string.

Specified by:
getValue in interface Metadata
Parameters:
key - a string key
Returns:
a string or null if the key is not found.

setValue

public final void setValue(String key,
                           String value)
Description copied from interface: Metadata
Stores a String value into this metadata, replacing any existing value for the given key.

Specified by:
setValue in interface Metadata
Parameters:
key - a string
value - the value to be stored.

isEmpty

public final boolean isEmpty()
Description copied from interface: Metadata
Checks if the metadata has any mapping defined.

Specified by:
isEmpty in interface Metadata
Returns:
true if there are no values in it, false otherwise.

keySet

public final Set<String> keySet()
Description copied from interface: Metadata
Returns a Set containing the strings used as keys in this metadata. If the metadata is empty, it will return an empty set.

Specified by:
keySet in interface Metadata
Returns:
a set of strings

getNode

public final MetadataNode getNode(String key)

setNode

public final void setNode(String key,
                          Metadata value)

containsNode

public final boolean containsNode(String key)

toString

public String toString()
Overrides:
toString in class Object

toByteArray

public byte[] toByteArray()
Specified by:
toByteArray in interface Metadata
Returns:
the current contents of this object, as a byte array.

fromByteArray

public static Metadata fromByteArray(byte[] bytes)
Parse the array into a Metadata object.

Parameters:
bytes - the serialized representation of the Metadata object
Returns:
the Metadata object, parsed from the byte array