blob: abf6c82583f7768049c47d6b9165188554fd28e0 [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.Attachment;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.ModuleMetadataRelatedResource;
import org.hl7.fhir.ModuleMetadataResourceType;
import org.hl7.fhir.Uri;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Module Metadata Related Resource</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataRelatedResourceImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataRelatedResourceImpl#getUri <em>Uri</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataRelatedResourceImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleMetadataRelatedResourceImpl#getDocument <em>Document</em>}</li>
* </ul>
*
* @generated
*/
public class ModuleMetadataRelatedResourceImpl extends BackboneElementImpl implements ModuleMetadataRelatedResource {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected ModuleMetadataResourceType type;
/**
* The cached value of the '{@link #getUri() <em>Uri</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUri()
* @generated
* @ordered
*/
protected Uri uri;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected org.hl7.fhir.String description;
/**
* The cached value of the '{@link #getDocument() <em>Document</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDocument()
* @generated
* @ordered
*/
protected Attachment document;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModuleMetadataRelatedResourceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getModuleMetadataRelatedResource();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModuleMetadataResourceType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(ModuleMetadataResourceType newType, NotificationChain msgs) {
ModuleMetadataResourceType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(ModuleMetadataResourceType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Uri getUri() {
return uri;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetUri(Uri newUri, NotificationChain msgs) {
Uri oldUri = uri;
uri = newUri;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI, oldUri, newUri);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUri(Uri newUri) {
if (newUri != uri) {
NotificationChain msgs = null;
if (uri != null)
msgs = ((InternalEObject)uri).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI, null, msgs);
if (newUri != null)
msgs = ((InternalEObject)newUri).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI, null, msgs);
msgs = basicSetUri(newUri, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI, newUri, newUri));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDescription(org.hl7.fhir.String newDescription, NotificationChain msgs) {
org.hl7.fhir.String oldDescription = description;
description = newDescription;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION, oldDescription, newDescription);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(org.hl7.fhir.String newDescription) {
if (newDescription != description) {
NotificationChain msgs = null;
if (description != null)
msgs = ((InternalEObject)description).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION, null, msgs);
if (newDescription != null)
msgs = ((InternalEObject)newDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION, null, msgs);
msgs = basicSetDescription(newDescription, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION, newDescription, newDescription));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Attachment getDocument() {
return document;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDocument(Attachment newDocument, NotificationChain msgs) {
Attachment oldDocument = document;
document = newDocument;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT, oldDocument, newDocument);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDocument(Attachment newDocument) {
if (newDocument != document) {
NotificationChain msgs = null;
if (document != null)
msgs = ((InternalEObject)document).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT, null, msgs);
if (newDocument != null)
msgs = ((InternalEObject)newDocument).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT, null, msgs);
msgs = basicSetDocument(newDocument, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT, newDocument, newDocument));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE:
return basicSetType(null, msgs);
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI:
return basicSetUri(null, msgs);
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION:
return basicSetDescription(null, msgs);
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT:
return basicSetDocument(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_RELATED_RESOURCE__TYPE:
return getType();
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI:
return getUri();
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION:
return getDescription();
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT:
return getDocument();
}
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_RELATED_RESOURCE__TYPE:
setType((ModuleMetadataResourceType)newValue);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI:
setUri((Uri)newValue);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION:
setDescription((org.hl7.fhir.String)newValue);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT:
setDocument((Attachment)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_RELATED_RESOURCE__TYPE:
setType((ModuleMetadataResourceType)null);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI:
setUri((Uri)null);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION:
setDescription((org.hl7.fhir.String)null);
return;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT:
setDocument((Attachment)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__TYPE:
return type != null;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__URI:
return uri != null;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DESCRIPTION:
return description != null;
case FhirPackage.MODULE_METADATA_RELATED_RESOURCE__DOCUMENT:
return document != null;
}
return super.eIsSet(featureID);
}
} //ModuleMetadataRelatedResourceImpl