public abstract class ObjectKey extends Object implements ObjectKeyInterface, Serializable, Comparable<ObjectKey>
| Modifier and Type | Field and Description |
|---|---|
protected String |
key |
static String |
OBJECT_TYPE |
KEY_SEPARATOR| Modifier | Constructor and Description |
|---|---|
protected |
ObjectKey()
Making default constructor protected, should not be used, except for
factory objects
|
protected |
ObjectKey(String type,
String IDInType)
Object constructor method.
|
protected |
ObjectKey(String type,
String IDInType,
String key)
Optimized constructor, for calls where we have both the
seperate and constructed key.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ObjectKey destObjectKey)
Implementation of the comparable interface so that object keys may be
used in sets that need a comparable interface.
|
boolean |
equals(Object obj)
Redefinition of the equality comparison, since ObjectKey objects are
very likely to be used as keys in Maps, or other ordered sets,
maps or lists.
|
int |
getIdInType()
Deprecated.
getIDInType() should be used instead. |
String |
getIDInType()
Returns a String that represents an identifier for a content object
within a type.
|
static ObjectKey |
getInstance(String key)
Instance generator.
|
String |
getKey()
Returns the actual key of the content object.
|
String |
getType()
Returns a type identifier for a content object.
|
int |
hashCode()
Hash code implementation to make object compatible with hash table
usage.
|
static String |
toObjectKeyString(String type,
String IDInType)
Optimized method to generate ObjectKey strings without the overhead
of creating an ObjectKey object.
|
String |
toString()
Converts the object to a string only to be used for debug display,
not serialization !
|
static void |
unregisterType(String type)
Removes a type registration.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildInstancepublic static final String OBJECT_TYPE
protected final String key
protected ObjectKey()
protected ObjectKey(String type, String IDInType)
type - a String specifying the object type. Normally this is used
mostly by children of this class but could be used for some "hacks".IDInType - the unique identifier within the type.protected ObjectKey(String type, String IDInType, String key)
type - a String specifying the object type. Normally this is used
mostly by children of this class but could be used for some "hacks".IDInType - the unique identifier within the type.key - the combined object key of the type and the IDInType. This is
generated with type + KEY_SEPARATOR + IDInTypepublic static void unregisterType(String type)
type - the name of the type to unregisterpublic static ObjectKey getInstance(String key) throws ClassNotFoundException
key - a String in the format : type + KEY_SEPARATOR + IDInTypeClassNotFoundException - if no class could be found for the type
passed in parameter.public String getKey()
ObjectKeyInterfacegetKey in interface ObjectKeyInterfacepublic String getType()
ObjectKeyInterfacegetType in interface ObjectKeyInterfacepublic String getIDInType()
ObjectKeyInterfacegetIDInType in interface ObjectKeyInterfacepublic int getIdInType()
getIDInType() should be used instead.public boolean equals(Object obj)
public int compareTo(ObjectKey destObjectKey) throws ClassCastException
compareTo in interface Comparable<ObjectKey>ClassCastException - thrown if the parameter is not of the
ObjectKey type.public int hashCode()
public String toString()
public static String toObjectKeyString(String type, String IDInType)
type - the objectKey typeIDInType - the identifier in the type for the objectKeyCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.