|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectthinkmap.client.EntityId
public final class EntityId
An EntityId is an object that uniquely identifies an entity in a datasource. An EntityId consists of an "entity type" and a set of keys. The entity type determines the "type" or namespace of entity this id (usually the same as the table name in a database) and the keys represent a set of identifiers that are unique to that namespace. EntityIds can be in two modes: open or closed, once an EntityId is closed, it becomes immutable and cannot be altered.
| Constructor Summary | |
|---|---|
EntityId()
Creates a new EntityId object. |
|
EntityId(EntityId id)
Creates a new EntityId object that is identical to another EntityId. |
|
EntityId(String entityType)
Creates a new EntityId object of a particular entity type. |
|
EntityId(String entityType,
Object... keyValues)
Creates a new EntityId object with the specified type and keys. |
|
| Method Summary | |
|---|---|
void |
addKey(Object o)
Adds a key to this EntityId. |
void |
close()
Close this EntityId and make it immutable. |
boolean |
equals(Object a)
|
static boolean |
equals(Object o1,
Object o2)
A utility method for comparing objects. |
static EntityId |
fromString(String idString)
Parse a string representing an EntityId. |
String |
getEntityType()
Get the EntityId's type name |
Object |
getKey(int i)
Get the key at the specified index. |
int |
getKeyCount()
Get the number of keys this EntityId contains. |
Object[] |
getKeys()
Get the keys of this EntityId. |
int |
hashCode()
|
boolean |
isClosed()
Determines if this EntityId is closed and is immutable. |
void |
setEntityType(String type)
Set the EntityId's type name. |
void |
setKeys(Object[] keys)
Set the keys of this EntityId. |
String |
toString()
|
void |
writeTo(IEntityHandler handler,
boolean md)
Serializes this EntityId over the given datasource entity handler. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EntityId()
public EntityId(String entityType)
public EntityId(String entityType,
Object... keyValues)
entityType - entity type namekeyValues - an array of objects to use as keys
public EntityId(EntityId id)
throws IllegalArgumentException
id - the EntityId to copy
IllegalArgumentException - if the EntityId to copy was not closed.| Method Detail |
|---|
public String getEntityType()
public void setEntityType(String type)
throws IllegalArgumentException
type - new type name
IllegalArgumentException - if the EntityId is closed.public int getKeyCount()
public Object getKey(int i)
i - key index
ith key
public Object[] getKeys()
public void setKeys(Object[] keys)
throws IllegalArgumentException
keys - an array of keys
IllegalArgumentException - if the EntityId is closed.
public void addKey(Object o)
throws IllegalArgumentException
o - a key to add
IllegalArgumentException - if the EntityId is closed.public boolean isClosed()
public void close()
public void writeTo(IEntityHandler handler,
boolean md)
handler - the IEntityHandler to write this EntityId tomd - true if this id represents metadata, false if it represents
data. If true is passed, all keys must be of type java.lang.Class.public static EntityId fromString(String idString)
idString - a string representing an EntityId
public final int hashCode()
hashCode in class Objectpublic final boolean equals(Object a)
equals in class Object
public static final boolean equals(Object o1,
Object o2)
o1 - first objecto2 - second object
public String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||