Interface ObjectReference
-
public interface ObjectReference
Provides a means to retrieve identity information about an object. Its methods primarily allow you to retrieve an object�s ID, as well as its associated class and object store IDs.You can get an instance of an object�s unique identity by calling
getObjectReference()
on theIndependentObject
andPropertyEngineObject
interfaces.IndependentObject.equals
(which overridesjava.lang.Object.equals
) delegates toObjectReference.equals
for object comparisons. Neither considers update sequence number (USN) in the comparison. If bothObjectReference
objects being compared have GUIDs (available within the client object) or paths or names, they are compared. Otherwise, the objects are considered to be not equal. No implicit round-trips to the Content Engine server are performed to resolve an identity to a GUID.
-
-
Method Summary
Methods Modifier and Type Method and Description java.lang.String
getClassIdentity()
Returns the class name of the object represented by this identity.java.lang.String
getObjectIdentity()
Returns the ID, name, or path of an independent object to which this identity refers.java.lang.String
getObjectStoreIdentity()
Returns the ID or name of the object store in which the referenced object resides.boolean
isResolved()
Returnstrue
when this identity is an ID (GUID), as it would be if resolved by the server.java.lang.String
toString()
Returns a string representation of the object represented by this identity.
-
-
-
Method Detail
-
isResolved
boolean isResolved()
Returnstrue
when this identity is an ID (GUID), as it would be if resolved by the server.Some factory methods instantiate an object using a name or a path and do not make a round-trip to the server (referred to as "fetchless instantiation"). If an object reference exists as a result of a call to one of these factory methods, this method returns
false
, indicating that there is no ID known to the API (that is, the reference is not "resolved"). If the object was instantiated with a method that persists the object to the object store immediately, or the object has been explicitly saved, this method returnstrue
.- Returns:
true
when the object identity is an ID (GUID); returnsfalse
when the object is referred to by name or path.
-
getObjectIdentity
java.lang.String getObjectIdentity()
Returns the ID, name, or path of an independent object to which this identity refers. The returned string can be an ID (in GUID format) or, if fetchless instantiation was used to create the object, the string might contain a name or path. This method returnsnull
if the identity is referencing a dependent object or an unevaluated object.- Returns:
- A
String
containing the object ID, name, or path. Returnsnull
in the case of a reference to a dependent or unevaluated object.
-
getObjectStoreIdentity
java.lang.String getObjectStoreIdentity()
Returns the ID or name of the object store in which the referenced object resides. The returned string is an ID (in GUID format) or, if fetchless instantiation was used to create the object, the string contains the object store name. For non-object store references, this method returnsnull
.- Returns:
- A
String
containing the object store ID or name. Returnsnull
in the case of a non-object store reference.
-
getClassIdentity
java.lang.String getClassIdentity()
Returns the class name of the object represented by this identity.- Returns:
- A
String
containing the class name.
-
toString
java.lang.String toString()
Returns a string representation of the object represented by this identity.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A
String
representing the object.
-
-