Class VAccessor<E extends Entity>

  • 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
    • Constructor Detail

      • VAccessor

        public VAccessor​(Class<E> clazz,
                         String role)
        Constructor.
        Parameters:
        clazz - the entity class
        role - 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 definition
        role - the role of the association (case of multiple associations with the same entity)
    • Method Detail

      • get

        public final E get()
        Returns:
        the entity
      • getUID

        public final UID<E> getUID()
        Returns:
        the entity uid
      • 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
      • setUID

        public final void setUID​(UID<E> uid)
        Sets the entity uri
        Parameters:
        uid - the entity uri
      • getRole

        public final String getRole()
        Returns:
        Role of this relation
      • isLoaded

        public final boolean isLoaded()
        Returns:
        if entity is already loaded