blob: 1df5f16422bd5966b9e876638f0ef32d18f61a92 [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.FhirPackage;
import org.hl7.fhir.ModuleMetadataContributor;
import org.hl7.fhir.ModuleMetadataContributorType;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Module Metadata Contributor</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataContributorImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataContributorImpl#getParty <em>Party</em>}</li>
* </ul>
*
* @generated
*/
public class ModuleMetadataContributorImpl extends BackboneElementImpl implements ModuleMetadataContributor {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected ModuleMetadataContributorType type;
/**
* The cached value of the '{@link #getParty() <em>Party</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParty()
* @generated
* @ordered
*/
protected Reference party;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModuleMetadataContributorImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getModuleMetadataContributor();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModuleMetadataContributorType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(ModuleMetadataContributorType newType, NotificationChain msgs) {
ModuleMetadataContributorType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(ModuleMetadataContributorType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getParty() {
return party;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetParty(Reference newParty, NotificationChain msgs) {
Reference oldParty = party;
party = newParty;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY, oldParty, newParty);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParty(Reference newParty) {
if (newParty != party) {
NotificationChain msgs = null;
if (party != null)
msgs = ((InternalEObject)party).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY, null, msgs);
if (newParty != null)
msgs = ((InternalEObject)newParty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY, null, msgs);
msgs = basicSetParty(newParty, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY, newParty, newParty));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE:
return basicSetType(null, msgs);
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY:
return basicSetParty(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.MODULE_METADATA_CONTRIBUTOR__TYPE:
return getType();
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY:
return getParty();
}
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.MODULE_METADATA_CONTRIBUTOR__TYPE:
setType((ModuleMetadataContributorType)newValue);
return;
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY:
setParty((Reference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE:
setType((ModuleMetadataContributorType)null);
return;
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY:
setParty((Reference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__TYPE:
return type != null;
case FhirPackage.MODULE_METADATA_CONTRIBUTOR__PARTY:
return party != null;
}
return super.eIsSet(featureID);
}
} //ModuleMetadataContributorImpl