blob: 98f397f55e321bec1f72433b54aaeb8648ecbcb2 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.Coding;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.ProvenanceAgent;
import org.hl7.fhir.ProvenanceEntity;
import org.hl7.fhir.ProvenanceEntityRole;
import org.hl7.fhir.Uri;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Provenance Entity</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ProvenanceEntityImpl#getRole <em>Role</em>}</li>
* <li>{@link org.hl7.fhir.impl.ProvenanceEntityImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.ProvenanceEntityImpl#getReference <em>Reference</em>}</li>
* <li>{@link org.hl7.fhir.impl.ProvenanceEntityImpl#getDisplay <em>Display</em>}</li>
* <li>{@link org.hl7.fhir.impl.ProvenanceEntityImpl#getAgent <em>Agent</em>}</li>
* </ul>
*
* @generated
*/
public class ProvenanceEntityImpl extends BackboneElementImpl implements ProvenanceEntity {
/**
* The cached value of the '{@link #getRole() <em>Role</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRole()
* @generated
* @ordered
*/
protected ProvenanceEntityRole role;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Coding type;
/**
* The cached value of the '{@link #getReference() <em>Reference</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getReference()
* @generated
* @ordered
*/
protected Uri reference;
/**
* The cached value of the '{@link #getDisplay() <em>Display</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDisplay()
* @generated
* @ordered
*/
protected org.hl7.fhir.String display;
/**
* The cached value of the '{@link #getAgent() <em>Agent</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAgent()
* @generated
* @ordered
*/
protected ProvenanceAgent agent;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProvenanceEntityImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getProvenanceEntity();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ProvenanceEntityRole getRole() {
return role;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRole(ProvenanceEntityRole newRole, NotificationChain msgs) {
ProvenanceEntityRole oldRole = role;
role = newRole;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__ROLE, oldRole, newRole);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRole(ProvenanceEntityRole newRole) {
if (newRole != role) {
NotificationChain msgs = null;
if (role != null)
msgs = ((InternalEObject)role).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__ROLE, null, msgs);
if (newRole != null)
msgs = ((InternalEObject)newRole).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__ROLE, null, msgs);
msgs = basicSetRole(newRole, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__ROLE, newRole, newRole));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Coding getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(Coding newType, NotificationChain msgs) {
Coding oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Coding newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Uri getReference() {
return reference;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetReference(Uri newReference, NotificationChain msgs) {
Uri oldReference = reference;
reference = newReference;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__REFERENCE, oldReference, newReference);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReference(Uri newReference) {
if (newReference != reference) {
NotificationChain msgs = null;
if (reference != null)
msgs = ((InternalEObject)reference).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__REFERENCE, null, msgs);
if (newReference != null)
msgs = ((InternalEObject)newReference).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__REFERENCE, null, msgs);
msgs = basicSetReference(newReference, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__REFERENCE, newReference, newReference));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getDisplay() {
return display;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDisplay(org.hl7.fhir.String newDisplay, NotificationChain msgs) {
org.hl7.fhir.String oldDisplay = display;
display = newDisplay;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__DISPLAY, oldDisplay, newDisplay);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDisplay(org.hl7.fhir.String newDisplay) {
if (newDisplay != display) {
NotificationChain msgs = null;
if (display != null)
msgs = ((InternalEObject)display).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__DISPLAY, null, msgs);
if (newDisplay != null)
msgs = ((InternalEObject)newDisplay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__DISPLAY, null, msgs);
msgs = basicSetDisplay(newDisplay, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__DISPLAY, newDisplay, newDisplay));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ProvenanceAgent getAgent() {
return agent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAgent(ProvenanceAgent newAgent, NotificationChain msgs) {
ProvenanceAgent oldAgent = agent;
agent = newAgent;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__AGENT, oldAgent, newAgent);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAgent(ProvenanceAgent newAgent) {
if (newAgent != agent) {
NotificationChain msgs = null;
if (agent != null)
msgs = ((InternalEObject)agent).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__AGENT, null, msgs);
if (newAgent != null)
msgs = ((InternalEObject)newAgent).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.PROVENANCE_ENTITY__AGENT, null, msgs);
msgs = basicSetAgent(newAgent, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.PROVENANCE_ENTITY__AGENT, newAgent, newAgent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.PROVENANCE_ENTITY__ROLE:
return basicSetRole(null, msgs);
case FhirPackage.PROVENANCE_ENTITY__TYPE:
return basicSetType(null, msgs);
case FhirPackage.PROVENANCE_ENTITY__REFERENCE:
return basicSetReference(null, msgs);
case FhirPackage.PROVENANCE_ENTITY__DISPLAY:
return basicSetDisplay(null, msgs);
case FhirPackage.PROVENANCE_ENTITY__AGENT:
return basicSetAgent(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirPackage.PROVENANCE_ENTITY__ROLE:
return getRole();
case FhirPackage.PROVENANCE_ENTITY__TYPE:
return getType();
case FhirPackage.PROVENANCE_ENTITY__REFERENCE:
return getReference();
case FhirPackage.PROVENANCE_ENTITY__DISPLAY:
return getDisplay();
case FhirPackage.PROVENANCE_ENTITY__AGENT:
return getAgent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.PROVENANCE_ENTITY__ROLE:
setRole((ProvenanceEntityRole)newValue);
return;
case FhirPackage.PROVENANCE_ENTITY__TYPE:
setType((Coding)newValue);
return;
case FhirPackage.PROVENANCE_ENTITY__REFERENCE:
setReference((Uri)newValue);
return;
case FhirPackage.PROVENANCE_ENTITY__DISPLAY:
setDisplay((org.hl7.fhir.String)newValue);
return;
case FhirPackage.PROVENANCE_ENTITY__AGENT:
setAgent((ProvenanceAgent)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.PROVENANCE_ENTITY__ROLE:
setRole((ProvenanceEntityRole)null);
return;
case FhirPackage.PROVENANCE_ENTITY__TYPE:
setType((Coding)null);
return;
case FhirPackage.PROVENANCE_ENTITY__REFERENCE:
setReference((Uri)null);
return;
case FhirPackage.PROVENANCE_ENTITY__DISPLAY:
setDisplay((org.hl7.fhir.String)null);
return;
case FhirPackage.PROVENANCE_ENTITY__AGENT:
setAgent((ProvenanceAgent)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.PROVENANCE_ENTITY__ROLE:
return role != null;
case FhirPackage.PROVENANCE_ENTITY__TYPE:
return type != null;
case FhirPackage.PROVENANCE_ENTITY__REFERENCE:
return reference != null;
case FhirPackage.PROVENANCE_ENTITY__DISPLAY:
return display != null;
case FhirPackage.PROVENANCE_ENTITY__AGENT:
return agent != null;
}
return super.eIsSet(featureID);
}
} //ProvenanceEntityImpl