blob: 54c38c3559543f167cdf193a19067b1272345da9 [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.ConsentData;
import org.hl7.fhir.ConsentDataMeaning;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Consent Data</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ConsentDataImpl#getMeaning <em>Meaning</em>}</li>
* <li>{@link org.hl7.fhir.impl.ConsentDataImpl#getReference <em>Reference</em>}</li>
* </ul>
*
* @generated
*/
public class ConsentDataImpl extends BackboneElementImpl implements ConsentData {
/**
* The cached value of the '{@link #getMeaning() <em>Meaning</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMeaning()
* @generated
* @ordered
*/
protected ConsentDataMeaning meaning;
/**
* The cached value of the '{@link #getReference() <em>Reference</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReference()
* @generated
* @ordered
*/
protected Reference reference;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ConsentDataImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getConsentData();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ConsentDataMeaning getMeaning() {
return meaning;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetMeaning(ConsentDataMeaning newMeaning, NotificationChain msgs) {
ConsentDataMeaning oldMeaning = meaning;
meaning = newMeaning;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONSENT_DATA__MEANING, oldMeaning, newMeaning);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMeaning(ConsentDataMeaning newMeaning) {
if (newMeaning != meaning) {
NotificationChain msgs = null;
if (meaning != null)
msgs = ((InternalEObject)meaning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONSENT_DATA__MEANING, null, msgs);
if (newMeaning != null)
msgs = ((InternalEObject)newMeaning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONSENT_DATA__MEANING, null, msgs);
msgs = basicSetMeaning(newMeaning, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONSENT_DATA__MEANING, newMeaning, newMeaning));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getReference() {
return reference;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetReference(Reference newReference, NotificationChain msgs) {
Reference oldReference = reference;
reference = newReference;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONSENT_DATA__REFERENCE, oldReference, newReference);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReference(Reference newReference) {
if (newReference != reference) {
NotificationChain msgs = null;
if (reference != null)
msgs = ((InternalEObject)reference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONSENT_DATA__REFERENCE, null, msgs);
if (newReference != null)
msgs = ((InternalEObject)newReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONSENT_DATA__REFERENCE, null, msgs);
msgs = basicSetReference(newReference, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONSENT_DATA__REFERENCE, newReference, newReference));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.CONSENT_DATA__MEANING:
return basicSetMeaning(null, msgs);
case FhirPackage.CONSENT_DATA__REFERENCE:
return basicSetReference(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.CONSENT_DATA__MEANING:
return getMeaning();
case FhirPackage.CONSENT_DATA__REFERENCE:
return getReference();
}
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.CONSENT_DATA__MEANING:
setMeaning((ConsentDataMeaning)newValue);
return;
case FhirPackage.CONSENT_DATA__REFERENCE:
setReference((Reference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.CONSENT_DATA__MEANING:
setMeaning((ConsentDataMeaning)null);
return;
case FhirPackage.CONSENT_DATA__REFERENCE:
setReference((Reference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.CONSENT_DATA__MEANING:
return meaning != null;
case FhirPackage.CONSENT_DATA__REFERENCE:
return reference != null;
}
return super.eIsSet(featureID);
}
} //ConsentDataImpl