blob: 9bd71b5f8fc6517f75d01d9cb8d33d0e58b93ccb [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.DocumentReference;
import org.eclipse.mdht.uml.fhir.core.resource.DocumentReferenceRelatesTo;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Reference Relates To</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.DocumentReferenceRelatesToImpl#getCode <em>Code</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.DocumentReferenceRelatesToImpl#getTarget <em>Target</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentReferenceRelatesToImpl extends BackboneElementImpl implements DocumentReferenceRelatesTo {
/**
* 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 #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected DocumentReference target;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentReferenceRelatesToImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getDocumentReferenceRelatesTo();
}
/**
* <!-- 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.DOCUMENT_REFERENCE_RELATES_TO__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.DOCUMENT_REFERENCE_RELATES_TO__CODE, oldCode, code));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DocumentReference getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (DocumentReference)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DocumentReference basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(DocumentReference newTarget) {
DocumentReference oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET, oldTarget, target));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__CODE:
if (resolve) return getCode();
return basicGetCode();
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
}
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.DOCUMENT_REFERENCE_RELATES_TO__CODE:
setCode((Code)newValue);
return;
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET:
setTarget((DocumentReference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__CODE:
setCode((Code)null);
return;
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET:
setTarget((DocumentReference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__CODE:
return code != null;
case FhirResourcePackage.DOCUMENT_REFERENCE_RELATES_TO__TARGET:
return target != null;
}
return super.eIsSet(featureID);
}
} //DocumentReferenceRelatesToImpl