de.deepamehta.core.model
Class TopicRoleModel
java.lang.Object
de.deepamehta.core.model.RoleModel
de.deepamehta.core.model.TopicRoleModel
- All Implemented Interfaces:
- Cloneable
public class TopicRoleModel
- extends RoleModel
The role a topic plays in an association.
A TopicRoleModel object is a pair of a topic reference and a role type reference.
The topic is refered to either by its ID or URI.
The role type is refered to by its URI.
Assertion: both, the topic reference and the role type reference are set.
In the database a role type is represented by a topic of type "dm4.core.role_type".
topicUri
private String topicUri
topicIdentifiedByUri
private boolean topicIdentifiedByUri
TopicRoleModel
public TopicRoleModel(long topicId,
String roleTypeUri)
TopicRoleModel
public TopicRoleModel(String topicUri,
String roleTypeUri)
TopicRoleModel
public TopicRoleModel(JSONObject topicRoleModel)
getPlayerId
public long getPlayerId()
- Overrides:
getPlayerId
in class RoleModel
getTopicUri
public String getTopicUri()
topicIdentifiedByUri
public boolean topicIdentifiedByUri()
refsSameObject
public boolean refsSameObject(RoleModel model)
- Description copied from class:
RoleModel
- Checks weather the given role model refers to the same object as this role model.
In case of a topic role model the topic IDs resp. URIs are compared.
In case of an association role model the association IDs are compared.
Note: the role types are not compared.
- Specified by:
refsSameObject
in class RoleModel
- Returns:
- true if the given role model refers to the same object as this role model.
toJSON
public JSONObject toJSON()
- Specified by:
toJSON
in class RoleModel
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2014. All Rights Reserved.