org.pentaho.reporting.libraries.resourceloader
Class ResourceKey

java.lang.Object
  extended by org.pentaho.reporting.libraries.resourceloader.ResourceKey
All Implemented Interfaces:
java.io.Serializable

public final class ResourceKey
extends java.lang.Object
implements java.io.Serializable

The key is an unique identifier for the resource. Most of the time, this may be an URL, but other (especially database based) schemas are possible.

A resource key must provide an 'equals' implementation. ResourceKeys should be implemented as immutable classes, so that they can be safely stored in collections or on external storages (like caches).

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
ResourceKey(java.lang.Object schema, java.lang.Object identifier, java.util.Map factoryParameters)
           
ResourceKey(ResourceKey parent, java.lang.Object schema, java.lang.Object identifier, java.util.Map factoryParameters)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Map getFactoryParameters()
           
 java.lang.Object getIdentifier()
           
 java.lang.String getIdentifierAsString()
          Returns a String version of the identifier.
 ResourceKey getParent()
           
 java.lang.Object getSchema()
          Returns the schema of this resource key.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceKey

public ResourceKey(java.lang.Object schema,
                   java.lang.Object identifier,
                   java.util.Map factoryParameters)

ResourceKey

public ResourceKey(ResourceKey parent,
                   java.lang.Object schema,
                   java.lang.Object identifier,
                   java.util.Map factoryParameters)
Method Detail

getParent

public ResourceKey getParent()

getFactoryParameters

public java.util.Map getFactoryParameters()

equals

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

hashCode

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

getIdentifier

public java.lang.Object getIdentifier()

getIdentifierAsString

public java.lang.String getIdentifierAsString()
Returns a String version of the identifier.

Returns:
the identifier as string or null, if the identifier could not be converted easily.

getSchema

public java.lang.Object getSchema()
Returns the schema of this resource key. The schema is an internal identifier to locate the resource-loader implementation that was responsible for creating the key in the first place.

The schema has no meaning outside the resource loading framework.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object