blob: 3351539999fdc173dfc0589d6ee54647a0ae3477 [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.DocumentManifestRelated;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Identifier;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Manifest Related</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.DocumentManifestRelatedImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.hl7.fhir.impl.DocumentManifestRelatedImpl#getRef <em>Ref</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentManifestRelatedImpl extends BackboneElementImpl implements DocumentManifestRelated {
/**
* The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifier()
* @generated
* @ordered
*/
protected Identifier identifier;
/**
* The cached value of the '{@link #getRef() <em>Ref</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRef()
* @generated
* @ordered
*/
protected Reference ref;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentManifestRelatedImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getDocumentManifestRelated();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Identifier getIdentifier() {
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIdentifier(Identifier newIdentifier, NotificationChain msgs) {
Identifier oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER, oldIdentifier, newIdentifier);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdentifier(Identifier newIdentifier) {
if (newIdentifier != identifier) {
NotificationChain msgs = null;
if (identifier != null)
msgs = ((InternalEObject)identifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER, null, msgs);
if (newIdentifier != null)
msgs = ((InternalEObject)newIdentifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER, null, msgs);
msgs = basicSetIdentifier(newIdentifier, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER, newIdentifier, newIdentifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getRef() {
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRef(Reference newRef, NotificationChain msgs) {
Reference oldRef = ref;
ref = newRef;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_MANIFEST_RELATED__REF, oldRef, newRef);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef(Reference newRef) {
if (newRef != ref) {
NotificationChain msgs = null;
if (ref != null)
msgs = ((InternalEObject)ref).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_MANIFEST_RELATED__REF, null, msgs);
if (newRef != null)
msgs = ((InternalEObject)newRef).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DOCUMENT_MANIFEST_RELATED__REF, null, msgs);
msgs = basicSetRef(newRef, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_MANIFEST_RELATED__REF, newRef, newRef));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER:
return basicSetIdentifier(null, msgs);
case FhirPackage.DOCUMENT_MANIFEST_RELATED__REF:
return basicSetRef(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.DOCUMENT_MANIFEST_RELATED__IDENTIFIER:
return getIdentifier();
case FhirPackage.DOCUMENT_MANIFEST_RELATED__REF:
return getRef();
}
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.DOCUMENT_MANIFEST_RELATED__IDENTIFIER:
setIdentifier((Identifier)newValue);
return;
case FhirPackage.DOCUMENT_MANIFEST_RELATED__REF:
setRef((Reference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER:
setIdentifier((Identifier)null);
return;
case FhirPackage.DOCUMENT_MANIFEST_RELATED__REF:
setRef((Reference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.DOCUMENT_MANIFEST_RELATED__IDENTIFIER:
return identifier != null;
case FhirPackage.DOCUMENT_MANIFEST_RELATED__REF:
return ref != null;
}
return super.eIsSet(featureID);
}
} //DocumentManifestRelatedImpl