org.qi4j.api.entity
Class EntityReference
java.lang.Object
org.qi4j.api.entity.EntityReference
- All Implemented Interfaces:
- java.io.Serializable
public final class EntityReference
- extends java.lang.Object
- implements java.io.Serializable
An EntityReference is identity of a specific Entity instance.
When stringified, the identity is used as-is. Example:
123456-abcde
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
EntityReference
public EntityReference(EntityComposite entityComposite)
- Parameters:
entityComposite
- a non-null EntityComposite
- Throws:
java.lang.NullPointerException
- if entityComposite is null
EntityReference
public EntityReference(java.lang.String identity)
- Parameters:
identity
- reference identity
- Throws:
NullArgumentException
- if identity is null or empty
parseURI
public static EntityReference parseURI(java.lang.String uri)
- Parse an URI to an EntityReference.
- Parameters:
uri
- the URI to parse
- Returns:
- the EntityReference represented by the given URI
parseEntityReference
public static EntityReference parseEntityReference(java.lang.String identity)
- Parse an Entity identity to an EntityReference.
- Parameters:
identity
- the EntityReference identity
- Returns:
- the EntityReference represented by the given identity
entityReferenceFor
public static EntityReference entityReferenceFor(java.lang.Object object)
- Parameters:
object
- an EntityComposite
- Returns:
- the EntityReference for the given EntityComposite
identity
public final java.lang.String identity()
- Returns:
- This EntityReference identity.
toURI
public java.lang.String toURI()
- Returns:
- An URI representation of this EntityReference.
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
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
- Returns:
- This EntityReference identity.