blob: 44427038b1c5e27cfd9eb3deb6199e13909b1ea0 [file] [log] [blame]
/*******************************************************************************
* 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 org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.mdht.uml.fhir.core.datatype.Code;
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.ModuleDefinitionParameter;
import org.eclipse.mdht.uml.fhir.core.resource.StructureDefinition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Module Definition Parameter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionParameterImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionParameterImpl#getUse <em>Use</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionParameterImpl#getDocumentation <em>Documentation</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionParameterImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ModuleDefinitionParameterImpl#getProfile <em>Profile</em>}</li>
* </ul>
*
* @generated
*/
public class ModuleDefinitionParameterImpl extends BackboneElementImpl implements ModuleDefinitionParameter {
/**
* The cached value of the '{@link #getName() <em>Name</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected Code name;
/**
* The cached value of the '{@link #getUse() <em>Use</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUse()
* @generated
* @ordered
*/
protected Code use;
/**
* The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDocumentation()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String documentation;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Code type;
/**
* The cached value of the '{@link #getProfile() <em>Profile</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProfile()
* @generated
* @ordered
*/
protected StructureDefinition profile;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModuleDefinitionParameterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getModuleDefinitionParameter();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getName() {
if (name != null && name.eIsProxy()) {
InternalEObject oldName = (InternalEObject)name;
name = (Code)eResolveProxy(oldName);
if (name != oldName) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__NAME, oldName, name));
}
}
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(Code newName) {
Code oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getUse() {
if (use != null && use.eIsProxy()) {
InternalEObject oldUse = (InternalEObject)use;
use = (Code)eResolveProxy(oldUse);
if (use != oldUse) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE, oldUse, use));
}
}
return use;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetUse() {
return use;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUse(Code newUse) {
Code oldUse = use;
use = newUse;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE, oldUse, use));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getDocumentation() {
if (documentation != null && documentation.eIsProxy()) {
InternalEObject oldDocumentation = (InternalEObject)documentation;
documentation = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldDocumentation);
if (documentation != oldDocumentation) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION, oldDocumentation, documentation));
}
}
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetDocumentation() {
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDocumentation(org.eclipse.mdht.uml.fhir.core.datatype.String newDocumentation) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldDocumentation = documentation;
documentation = newDocumentation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION, oldDocumentation, documentation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (Code)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Code newType) {
Code oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructureDefinition getProfile() {
if (profile != null && profile.eIsProxy()) {
InternalEObject oldProfile = (InternalEObject)profile;
profile = (StructureDefinition)eResolveProxy(oldProfile);
if (profile != oldProfile) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE, oldProfile, profile));
}
}
return profile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructureDefinition basicGetProfile() {
return profile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProfile(StructureDefinition newProfile) {
StructureDefinition oldProfile = profile;
profile = newProfile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE, oldProfile, profile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__NAME:
if (resolve) return getName();
return basicGetName();
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE:
if (resolve) return getUse();
return basicGetUse();
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION:
if (resolve) return getDocumentation();
return basicGetDocumentation();
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE:
if (resolve) return getType();
return basicGetType();
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE:
if (resolve) return getProfile();
return basicGetProfile();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__NAME:
setName((Code)newValue);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE:
setUse((Code)newValue);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION:
setDocumentation((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE:
setType((Code)newValue);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE:
setProfile((StructureDefinition)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_PARAMETER__NAME:
setName((Code)null);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE:
setUse((Code)null);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION:
setDocumentation((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE:
setType((Code)null);
return;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE:
setProfile((StructureDefinition)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__NAME:
return name != null;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__USE:
return use != null;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__DOCUMENTATION:
return documentation != null;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__TYPE:
return type != null;
case FhirResourcePackage.MODULE_DEFINITION_PARAMETER__PROFILE:
return profile != null;
}
return super.eIsSet(featureID);
}
} //ModuleDefinitionParameterImpl