org.peaseplate.internal
Interface ResourceKey

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DefaultResourceKey

public interface ResourceKey
extends java.io.Serializable

A unique key that describes the resource using the specified name and the locale. The additional encoding is used for loading the resource, but is not part of the key itself, which means that it is not part of the hashCode and equals methods. These two methods must be implemented but only target the name and the locale.

Author:
Manfred HANTSCHEL

Method Summary
 boolean equals(java.lang.Object object)
          Must implement the equals method
 java.lang.String getEncoding()
          Returns the encoding of the resource
 java.util.Locale getLocale()
          Returns the locale of the resource
 java.lang.String getName()
          Returns the name of the resource
 ResourceKey getParent()
          Returns a resource key with the same name and the parent locale If the locale is already null, there is no parent and it returns null.
 int hashCode()
          Must implement the hashCode method
 java.lang.String toString()
          Returns a textual representation
 

Method Detail

getName

java.lang.String getName()
Returns the name of the resource

Returns:
the name of the resource

getLocale

java.util.Locale getLocale()
Returns the locale of the resource

Returns:
the locale of the resource

getEncoding

java.lang.String getEncoding()
Returns the encoding of the resource

Returns:
the encoding of the resource

getParent

ResourceKey getParent()
Returns a resource key with the same name and the parent locale If the locale is already null, there is no parent and it returns null.

Returns:
the parent or null

hashCode

int hashCode()
Must implement the hashCode method

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

equals

boolean equals(java.lang.Object object)
Must implement the equals method

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to compare
Returns:
true if equal

toString

java.lang.String toString()
Returns a textual representation

Overrides:
toString in class java.lang.Object
Returns:
a textual representation


Copyright © 2008. All Rights Reserved.