| /******************************************************************************* |
| * Copyright (c) 2016 David Carlson and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.resource.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| 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.EObjectResolvingEList; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.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.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionValueSetImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionValueSetImpl#getIdentifier <em>Identifier</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionValueSetImpl#getVersion <em>Version</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionValueSetImpl#getCodeSystems <em>Code System</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ModuleDefinitionValueSetImpl extends BackboneElementImpl implements ModuleDefinitionValueSet { |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String name; |
| |
| /** |
| * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String identifier; |
| |
| /** |
| * The cached value of the '{@link #getVersion() <em>Version</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVersion() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String version; |
| |
| /** |
| * The cached value of the '{@link #getCodeSystems() <em>Code System</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCodeSystems() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.eclipse.mdht.uml.fhir.core.datatype.String> codeSystems; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ModuleDefinitionValueSetImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getModuleDefinitionValueSet(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getName() { |
| if (name != null && name.eIsProxy()) { |
| InternalEObject oldName = (InternalEObject)name; |
| name = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldName); |
| if (name != oldName) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME, oldName, name)); |
| } |
| } |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(org.eclipse.mdht.uml.fhir.core.datatype.String newName) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getIdentifier() { |
| if (identifier != null && identifier.eIsProxy()) { |
| InternalEObject oldIdentifier = (InternalEObject)identifier; |
| identifier = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldIdentifier); |
| if (identifier != oldIdentifier) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| } |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetIdentifier() { |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIdentifier(org.eclipse.mdht.uml.fhir.core.datatype.String newIdentifier) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldIdentifier = identifier; |
| identifier = newIdentifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getVersion() { |
| if (version != null && version.eIsProxy()) { |
| InternalEObject oldVersion = (InternalEObject)version; |
| version = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldVersion); |
| if (version != oldVersion) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION, oldVersion, version)); |
| } |
| } |
| return version; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetVersion() { |
| return version; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setVersion(org.eclipse.mdht.uml.fhir.core.datatype.String newVersion) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldVersion = version; |
| version = newVersion; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION, oldVersion, version)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.eclipse.mdht.uml.fhir.core.datatype.String> getCodeSystems() { |
| if (codeSystems == null) { |
| codeSystems = new EObjectResolvingEList<org.eclipse.mdht.uml.fhir.core.datatype.String>(org.eclipse.mdht.uml.fhir.core.datatype.String.class, this, FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM); |
| } |
| return codeSystems; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME: |
| if (resolve) return getName(); |
| return basicGetName(); |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER: |
| if (resolve) return getIdentifier(); |
| return basicGetIdentifier(); |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION: |
| if (resolve) return getVersion(); |
| return basicGetVersion(); |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM: |
| return getCodeSystems(); |
| } |
| 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 FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER: |
| setIdentifier((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION: |
| setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM: |
| getCodeSystems().clear(); |
| getCodeSystems().addAll((Collection<? extends org.eclipse.mdht.uml.fhir.core.datatype.String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME: |
| setName((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER: |
| setIdentifier((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION: |
| setVersion((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM: |
| getCodeSystems().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__NAME: |
| return name != null; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__IDENTIFIER: |
| return identifier != null; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__VERSION: |
| return version != null; |
| case FhirResourcePackage.MODULE_DEFINITION_VALUE_SET__CODE_SYSTEM: |
| return codeSystems != null && !codeSystems.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ModuleDefinitionValueSetImpl |