blob: e78fe3acac982b002f0e769cf1711840cf5e6a3d [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.ImplementationGuideGlobal;
import org.eclipse.mdht.uml.fhir.core.resource.StructureDefinition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Implementation Guide Global</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuideGlobalImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ImplementationGuideGlobalImpl#getProfile <em>Profile</em>}</li>
* </ul>
*
* @generated
*/
public class ImplementationGuideGlobalImpl extends BackboneElementImpl implements ImplementationGuideGlobal {
/**
* 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 ImplementationGuideGlobalImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getImplementationGuideGlobal();
}
/**
* <!-- 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.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__PROFILE, oldProfile, profile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.IMPLEMENTATION_GUIDE_GLOBAL__TYPE:
if (resolve) return getType();
return basicGetType();
case FhirResourcePackage.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__TYPE:
setType((Code)newValue);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__TYPE:
setType((Code)null);
return;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_GLOBAL__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.IMPLEMENTATION_GUIDE_GLOBAL__TYPE:
return type != null;
case FhirResourcePackage.IMPLEMENTATION_GUIDE_GLOBAL__PROFILE:
return profile != null;
}
return super.eIsSet(featureID);
}
} //ImplementationGuideGlobalImpl