blob: e08198e138877646da4eb508d83128879db9fce9 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.ModuleDefinitionValueSet;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Module Definition Value Set</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ModuleDefinitionValueSetImpl#getName <em>Name</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleDefinitionValueSetImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleDefinitionValueSetImpl#getVersion <em>Version</em>}</li>
* <li>{@link org.hl7.fhir.impl.ModuleDefinitionValueSetImpl#getCodeSystem <em>Code System</em>}</li>
* </ul>
*
* @generated
*/
public class ModuleDefinitionValueSetImpl extends BackboneElementImpl implements ModuleDefinitionValueSet {
/**
* The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected org.hl7.fhir.String name;
/**
* The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifier()
* @generated
* @ordered
*/
protected org.hl7.fhir.String identifier;
/**
* The cached value of the '{@link #getVersion() <em>Version</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected org.hl7.fhir.String version;
/**
* The cached value of the '{@link #getCodeSystem() <em>Code System</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCodeSystem()
* @generated
* @ordered
*/
protected EList<org.hl7.fhir.String> codeSystem;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModuleDefinitionValueSetImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getModuleDefinitionValueSet();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetName(org.hl7.fhir.String newName, NotificationChain msgs) {
org.hl7.fhir.String oldName = name;
name = newName;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME, oldName, newName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(org.hl7.fhir.String newName) {
if (newName != name) {
NotificationChain msgs = null;
if (name != null)
msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME, null, msgs);
if (newName != null)
msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME, null, msgs);
msgs = basicSetName(newName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME, newName, newName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getIdentifier() {
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIdentifier(org.hl7.fhir.String newIdentifier, NotificationChain msgs) {
org.hl7.fhir.String oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, oldIdentifier, newIdentifier);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdentifier(org.hl7.fhir.String newIdentifier) {
if (newIdentifier != identifier) {
NotificationChain msgs = null;
if (identifier != null)
msgs = ((InternalEObject)identifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, null, msgs);
if (newIdentifier != null)
msgs = ((InternalEObject)newIdentifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, null, msgs);
msgs = basicSetIdentifier(newIdentifier, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, newIdentifier, newIdentifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getVersion() {
return version;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetVersion(org.hl7.fhir.String newVersion, NotificationChain msgs) {
org.hl7.fhir.String oldVersion = version;
version = newVersion;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION, oldVersion, newVersion);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVersion(org.hl7.fhir.String newVersion) {
if (newVersion != version) {
NotificationChain msgs = null;
if (version != null)
msgs = ((InternalEObject)version).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION, null, msgs);
if (newVersion != null)
msgs = ((InternalEObject)newVersion).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION, null, msgs);
msgs = basicSetVersion(newVersion, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION, newVersion, newVersion));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<org.hl7.fhir.String> getCodeSystem() {
if (codeSystem == null) {
codeSystem = new EObjectContainmentEList<org.hl7.fhir.String>(org.hl7.fhir.String.class, this, FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM);
}
return codeSystem;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME:
return basicSetName(null, msgs);
case FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER:
return basicSetIdentifier(null, msgs);
case FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION:
return basicSetVersion(null, msgs);
case FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM:
return ((InternalEList<?>)getCodeSystem()).basicRemove(otherEnd, 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_DEFINITION_VALUE_SET__NAME:
return getName();
case FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER:
return getIdentifier();
case FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION:
return getVersion();
case FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM:
return getCodeSystem();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME:
setName((org.hl7.fhir.String)newValue);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER:
setIdentifier((org.hl7.fhir.String)newValue);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION:
setVersion((org.hl7.fhir.String)newValue);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM:
getCodeSystem().clear();
getCodeSystem().addAll((Collection<? extends org.hl7.fhir.String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME:
setName((org.hl7.fhir.String)null);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER:
setIdentifier((org.hl7.fhir.String)null);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION:
setVersion((org.hl7.fhir.String)null);
return;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM:
getCodeSystem().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.MODULE_DEFINITION_VALUE_SET__NAME:
return name != null;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER:
return identifier != null;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__VERSION:
return version != null;
case FhirPackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM:
return codeSystem != null && !codeSystem.isEmpty();
}
return super.eIsSet(featureID);
}
} //ModuleDefinitionValueSetImpl