blob: 8465a1e270315e6124d45793b6386987a0bc42db [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.Identifier;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.DocumentReferenceContextRelated;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.Resource;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Reference Context Related</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.DocumentReferenceContextRelatedImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.DocumentReferenceContextRelatedImpl#getRef <em>Ref</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentReferenceContextRelatedImpl extends BackboneElementImpl implements DocumentReferenceContextRelated {
/**
* The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifier()
* @generated
* @ordered
*/
protected Identifier identifier;
/**
* The cached value of the '{@link #getRef() <em>Ref</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRef()
* @generated
* @ordered
*/
protected Resource ref;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentReferenceContextRelatedImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getDocumentReferenceContextRelated();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Identifier getIdentifier() {
if (identifier != null && identifier.eIsProxy()) {
InternalEObject oldIdentifier = (InternalEObject)identifier;
identifier = (Identifier)eResolveProxy(oldIdentifier);
if (identifier != oldIdentifier) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__IDENTIFIER, oldIdentifier, identifier));
}
}
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Identifier basicGetIdentifier() {
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdentifier(Identifier newIdentifier) {
Identifier oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__IDENTIFIER, oldIdentifier, identifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource getRef() {
if (ref != null && ref.eIsProxy()) {
InternalEObject oldRef = (InternalEObject)ref;
ref = (Resource)eResolveProxy(oldRef);
if (ref != oldRef) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF, oldRef, ref));
}
}
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource basicGetRef() {
return ref;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRef(Resource newRef) {
Resource oldRef = ref;
ref = newRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF, oldRef, ref));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__IDENTIFIER:
if (resolve) return getIdentifier();
return basicGetIdentifier();
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF:
if (resolve) return getRef();
return basicGetRef();
}
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_CONTEXT_RELATED__IDENTIFIER:
setIdentifier((Identifier)newValue);
return;
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF:
setRef((Resource)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_CONTEXT_RELATED__IDENTIFIER:
setIdentifier((Identifier)null);
return;
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF:
setRef((Resource)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__IDENTIFIER:
return identifier != null;
case FhirResourcePackage.DOCUMENT_REFERENCE_CONTEXT_RELATED__REF:
return ref != null;
}
return super.eIsSet(featureID);
}
} //DocumentReferenceContextRelatedImpl