blob: 5077d7c2c994d8c86edda16cb5f74861e2871076 [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.CarePlan;
import org.eclipse.mdht.uml.fhir.core.resource.CarePlanRelatedPlan;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Care Plan Related Plan</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.CarePlanRelatedPlanImpl#getCode <em>Code</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.CarePlanRelatedPlanImpl#getPlan <em>Plan</em>}</li>
* </ul>
*
* @generated
*/
public class CarePlanRelatedPlanImpl extends BackboneElementImpl implements CarePlanRelatedPlan {
/**
* The cached value of the '{@link #getCode() <em>Code</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCode()
* @generated
* @ordered
*/
protected Code code;
/**
* The cached value of the '{@link #getPlan() <em>Plan</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPlan()
* @generated
* @ordered
*/
protected CarePlan plan;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CarePlanRelatedPlanImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getCarePlanRelatedPlan();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getCode() {
if (code != null && code.eIsProxy()) {
InternalEObject oldCode = (InternalEObject)code;
code = (Code)eResolveProxy(oldCode);
if (code != oldCode) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CARE_PLAN_RELATED_PLAN__CODE, oldCode, code));
}
}
return code;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetCode() {
return code;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCode(Code newCode) {
Code oldCode = code;
code = newCode;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CARE_PLAN_RELATED_PLAN__CODE, oldCode, code));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CarePlan getPlan() {
if (plan != null && plan.eIsProxy()) {
InternalEObject oldPlan = (InternalEObject)plan;
plan = (CarePlan)eResolveProxy(oldPlan);
if (plan != oldPlan) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN, oldPlan, plan));
}
}
return plan;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CarePlan basicGetPlan() {
return plan;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPlan(CarePlan newPlan) {
CarePlan oldPlan = plan;
plan = newPlan;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN, oldPlan, plan));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__CODE:
if (resolve) return getCode();
return basicGetCode();
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN:
if (resolve) return getPlan();
return basicGetPlan();
}
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.CARE_PLAN_RELATED_PLAN__CODE:
setCode((Code)newValue);
return;
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN:
setPlan((CarePlan)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__CODE:
setCode((Code)null);
return;
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN:
setPlan((CarePlan)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__CODE:
return code != null;
case FhirResourcePackage.CARE_PLAN_RELATED_PLAN__PLAN:
return plan != null;
}
return super.eIsSet(featureID);
}
} //CarePlanRelatedPlanImpl