001package de.deepamehta.core.model; 002 003 004 005/** 006 * Collection of the data that makes up an {@link Association}. 007 * 008 * @author <a href="mailto:jri@deepamehta.de">Jörg Richter</a> 009 */ 010public interface AssociationModel extends DeepaMehtaObjectModel { 011 012 RoleModel getRoleModel1(); 013 014 RoleModel getRoleModel2(); 015 016 // --- 017 018 void setRoleModel1(RoleModel roleModel1); 019 020 void setRoleModel2(RoleModel roleModel2); 021 022 // --- Convenience Methods --- 023 024 /** 025 * @teturn this association's role that matches the given role type. 026 * If no role matches, null is returned. 027 * <p> 028 * If both roles are matching an exception is thrown. 029 */ 030 RoleModel getRoleModel(String roleTypeUri); 031 032 long getOtherPlayerId(long id); 033 034 boolean hasSameRoleTypeUris(); 035 036 // --- 037 038 AssociationModel clone(); 039}