org.jboss.portal.core.model.portal
Class PortalObjectId

java.lang.Object
  extended by org.jboss.portal.core.model.portal.PortalObjectId
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class PortalObjectId
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

A composite id for a portal object in the scope of its container.

Version:
$Revision: 1.1 $
Author:
Julien Viet
See Also:
Serialized Form

Field Summary
static char NAMESPACE_SEPARATOR
           
 
Constructor Summary
PortalObjectId(java.lang.String namespace, PortalObjectPath path)
          Build a new portal object id.
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getNamespace()
          Returns the portal object namespace.
 PortalObjectPath getPath()
          Returns the portal object path.
 int hashCode()
           
static PortalObjectId parse(java.lang.String idValue, PortalObjectPath.Format format)
          Parse a portal object id given its string representation.
static PortalObjectId parse(java.lang.String namespace, java.lang.String pathValue, PortalObjectPath.Format format)
          Parse a portal object id given the namespace and the path string representation.
 java.lang.String toString()
          Returns the canonical representation.
 java.lang.String toString(PortalObjectPath.Format format)
          Returns the portal object id string value.
static java.lang.String toString(java.lang.String namespace, PortalObjectPath path, PortalObjectPath.Format format)
          Format a portal object id values to a string value.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NAMESPACE_SEPARATOR

public static final char NAMESPACE_SEPARATOR
See Also:
Constant Field Values
Constructor Detail

PortalObjectId

public PortalObjectId(java.lang.String namespace,
                      PortalObjectPath path)
               throws java.lang.IllegalArgumentException
Build a new portal object id.

Parameters:
namespace - the namespace value
path - the path object
Throws:
java.lang.IllegalArgumentException - if any argument is null
Method Detail

getNamespace

public java.lang.String getNamespace()
Returns the portal object namespace.

Returns:
the namespace

getPath

public PortalObjectPath getPath()
Returns the portal object path.

Returns:
the path

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

parse

public static PortalObjectId parse(java.lang.String idValue,
                                   PortalObjectPath.Format format)
                            throws java.lang.IllegalArgumentException
Parse a portal object id given its string representation.

Parameters:
idValue - the id string value
format - the format
Returns:
the PortalObjectId
Throws:
java.lang.IllegalArgumentException - if any argument is null or not well formed

parse

public static PortalObjectId parse(java.lang.String namespace,
                                   java.lang.String pathValue,
                                   PortalObjectPath.Format format)
                            throws java.lang.IllegalArgumentException
Parse a portal object id given the namespace and the path string representation.

Parameters:
namespace - the namespace value
pathValue - the path value
format - the path format
Returns:
the PortalObjectId
Throws:
java.lang.IllegalArgumentException - if any argument is null or not well formed

toString

public java.lang.String toString()
Returns the canonical representation.

Overrides:
toString in class java.lang.Object
Returns:
the string value

toString

public java.lang.String toString(PortalObjectPath.Format format)
                          throws java.lang.IllegalArgumentException
Returns the portal object id string value.

Parameters:
format - the path format
Returns:
a formated portal object id value
Throws:
java.lang.IllegalArgumentException - if the format argument is null

toString

public static java.lang.String toString(java.lang.String namespace,
                                        PortalObjectPath path,
                                        PortalObjectPath.Format format)
                                 throws java.lang.IllegalArgumentException
Format a portal object id values to a string value.

Parameters:
namespace - the id value
path - the id path
format - the desired format
Returns:
the formated value
Throws:
java.lang.IllegalArgumentException - if any argument is null or not well formed

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable