org.clapper.curn
Class PersistentMetadataGroup

java.lang.Object
  extended by org.clapper.curn.PersistentMetadataGroup

public class PersistentMetadataGroup
extends java.lang.Object

Contains one group of persistent metadata about a feed or an item. Persistent metadata consists of name/value pairs aggregated into namespaces. An instance of this class represents one namespace's worth of metadata for a feed or an item.

Version:
$Revision: 6547 $

Constructor Summary
PersistentMetadataGroup(java.lang.String namespace)
          Creates a new instance of PersistentMetadataGroup.
 
Method Summary
 void addMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
          Add an entire map-ful of metadata to this group.
 void addMetadataItem(java.lang.String name, java.lang.String value)
          Add a name/value pair to this metadata group.
 boolean equals(java.lang.Object o)
          Determine whether this object is equivalent to another.
 java.util.Map<java.lang.String,java.lang.String> getMetadata()
          Get the name/value pairs (i.e., the actual data) associated with this metadata group.
 java.lang.String getNamespace()
          Get the namespace for this group.
 java.util.Map<java.lang.String,java.lang.String> getNameValuePairs()
           
 int hashCode()
          Get the hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentMetadataGroup

public PersistentMetadataGroup(java.lang.String namespace)
Creates a new instance of PersistentMetadataGroup.

Parameters:
namespace - the namespace for this group
Method Detail

getNamespace

public java.lang.String getNamespace()
Get the namespace for this group.

Returns:
the namespace

addMetadataItem

public void addMetadataItem(java.lang.String name,
                            java.lang.String value)
Add a name/value pair to this metadata group.

Parameters:
name - the name
value - the value

addMetadata

public void addMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Add an entire map-ful of metadata to this group.

Parameters:
metadata - the data

getMetadata

public java.util.Map<java.lang.String,java.lang.String> getMetadata()
Get the name/value pairs (i.e., the actual data) associated with this metadata group.

Returns:
a Map of name/value pair data

getNameValuePairs

public java.util.Map<java.lang.String,java.lang.String> getNameValuePairs()

hashCode

public int hashCode()
Get the hash code. Items of this type are hashed by namespace.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

equals

public boolean equals(java.lang.Object o)
Determine whether this object is equivalent to another. A PersistentMetadataGroup object is equivalent to another only if (a) both objects have the same namespace, and (b) both objects contain the same data.

Overrides:
equals in class java.lang.Object
Parameters:
o - the other object


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.