blob: c563934d709729e241efdc9a3212653e79fcd98f [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.ActionParticipantType;
import org.hl7.fhir.ActivityDefinitionParticipant;
import org.hl7.fhir.CodeableConcept;
import org.hl7.fhir.FhirPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Activity Definition Participant</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ActivityDefinitionParticipantImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.ActivityDefinitionParticipantImpl#getRole <em>Role</em>}</li>
* </ul>
*
* @generated
*/
public class ActivityDefinitionParticipantImpl extends BackboneElementImpl implements ActivityDefinitionParticipant {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected ActionParticipantType type;
/**
* The cached value of the '{@link #getRole() <em>Role</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRole()
* @generated
* @ordered
*/
protected CodeableConcept role;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ActivityDefinitionParticipantImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getActivityDefinitionParticipant();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActionParticipantType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(ActionParticipantType newType, NotificationChain msgs) {
ActionParticipantType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(ActionParticipantType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getRole() {
return role;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRole(CodeableConcept newRole, NotificationChain msgs) {
CodeableConcept oldRole = role;
role = newRole;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE, oldRole, newRole);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRole(CodeableConcept newRole) {
if (newRole != role) {
NotificationChain msgs = null;
if (role != null)
msgs = ((InternalEObject)role).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE, null, msgs);
if (newRole != null)
msgs = ((InternalEObject)newRole).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE, null, msgs);
msgs = basicSetRole(newRole, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE, newRole, newRole));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE:
return basicSetType(null, msgs);
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE:
return basicSetRole(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE:
return getType();
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE:
return getRole();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE:
setType((ActionParticipantType)newValue);
return;
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE:
setRole((CodeableConcept)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE:
setType((ActionParticipantType)null);
return;
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE:
setRole((CodeableConcept)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__TYPE:
return type != null;
case FhirPackage.ACTIVITY_DEFINITION_PARTICIPANT__ROLE:
return role != null;
}
return super.eIsSet(featureID);
}
} //ActivityDefinitionParticipantImpl