Class VAccessor<E extends Entity>
- java.lang.Object
-
- io.vertigo.datamodel.structure.model.VAccessor<E>
-
- Type Parameters:
E- the type of entity
- All Implemented Interfaces:
Serializable
public class VAccessor<E extends Entity> extends Object implements Serializable
This class is a way to access an entity defined by a relationship. It's a kind of box (aka optional) that offers a small list of methods.- Author:
- pchretien
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Eget()SerializablegetId()StringgetRole()UID<E>getUID()booleanisLoaded()voidset(E entity)Sets the entityvoidsetId(Serializable id)Sets the entity idvoidsetUID(UID<E> uid)Sets the entity uri
-
-
-
Constructor Detail
-
VAccessor
public VAccessor(Class<E> clazz, String role)
Constructor.- Parameters:
clazz- the entity classrole- the role of the association (case of multiple associations with the same entity)
-
VAccessor
public VAccessor(DtDefinition targetDtDefinition, String role)
Constructor.- Parameters:
targetDtDefinition- the entity definitionrole- the role of the association (case of multiple associations with the same entity)
-
-
Method Detail
-
get
public final E get()
- Returns:
- the entity
-
getId
public final Serializable getId()
- Returns:
- the entity id
-
set
public final void set(E entity)
Sets the entity- Parameters:
entity- the entity
-
setId
public final void setId(Serializable id)
Sets the entity id- Parameters:
id- the entity id
-
getRole
public final String getRole()
- Returns:
- Role of this relation
-
isLoaded
public final boolean isLoaded()
- Returns:
- if entity is already loaded
-
-