|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.EntityReference<T>
T
- the type of the entity on which this reference is about.public abstract class EntityReference<T>
A reference to an entity in Silverpeas.
An entity is a business object in Silverpeas that is persisted in a data source. Some times,
instead of refering a peculiar entity, an object can refer an entity whatever its type; this is
why it refers such objects with an EntityReference
instance.
The type of the entity referred by a such reference is defined by the type of the reference
itself; An entity reference must be concrete and its type carries the type of the entity it is
upon. For example, you can implement a reference to a user by naming it
UserReference
.
Field Summary | |
---|---|
static String |
UNKNOWN_TYPE
|
Constructor Summary | |
---|---|
EntityReference(String id)
Constructs a reference targeting the entity identified by the specified unique identifier. |
Method Summary | |
---|---|
boolean |
equals(Object anotherReference)
|
abstract T |
getEntity()
Gets the instance of the entity targeted by this reference. |
String |
getId()
Gets the unique identifier of the entity referred by this reference. |
String |
getType()
Gets the name of the entity type referred by this reference. |
static String |
getType(Class aClass)
Extracts automatically the type from a Class . |
static String |
getType(String classSimpleName)
Extracts automatically the type from a simple name of Class . |
int |
hashCode()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UNKNOWN_TYPE
Constructor Detail |
---|
public EntityReference(String id)
id
- the unique identifier of the entity to refer.Method Detail |
---|
public final String getId()
public final String getType()
UserDetail
, only the term User
is kept and then set in upper case.
Not all technical terms are detected; for instance, only the following technical terms are
taken into account: Silverpeas, Detail, Interface, Silver, Content, Full, and Complete.
public static String getType(Class aClass)
Class
.
public static String getType(String classSimpleName)
Class
.
public abstract T getEntity()
public int hashCode()
hashCode
in class Object
public boolean equals(Object anotherReference)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |