blob: d3113b6e64fa38b450a98638946248cf06167175 [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.CodeableConcept;
import org.hl7.fhir.DateTime;
import org.hl7.fhir.DetectedIssueMitigation;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Detected Issue Mitigation</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.DetectedIssueMitigationImpl#getAction <em>Action</em>}</li>
* <li>{@link org.hl7.fhir.impl.DetectedIssueMitigationImpl#getDate <em>Date</em>}</li>
* <li>{@link org.hl7.fhir.impl.DetectedIssueMitigationImpl#getAuthor <em>Author</em>}</li>
* </ul>
*
* @generated
*/
public class DetectedIssueMitigationImpl extends BackboneElementImpl implements DetectedIssueMitigation {
/**
* The cached value of the '{@link #getAction() <em>Action</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected CodeableConcept action;
/**
* The cached value of the '{@link #getDate() <em>Date</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDate()
* @generated
* @ordered
*/
protected DateTime date;
/**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected Reference author;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DetectedIssueMitigationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getDetectedIssueMitigation();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getAction() {
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAction(CodeableConcept newAction, NotificationChain msgs) {
CodeableConcept oldAction = action;
action = newAction;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION, oldAction, newAction);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAction(CodeableConcept newAction) {
if (newAction != action) {
NotificationChain msgs = null;
if (action != null)
msgs = ((InternalEObject)action).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION, null, msgs);
if (newAction != null)
msgs = ((InternalEObject)newAction).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION, null, msgs);
msgs = basicSetAction(newAction, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION, newAction, newAction));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DateTime getDate() {
return date;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDate(DateTime newDate, NotificationChain msgs) {
DateTime oldDate = date;
date = newDate;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__DATE, oldDate, newDate);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDate(DateTime newDate) {
if (newDate != date) {
NotificationChain msgs = null;
if (date != null)
msgs = ((InternalEObject)date).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__DATE, null, msgs);
if (newDate != null)
msgs = ((InternalEObject)newDate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__DATE, null, msgs);
msgs = basicSetDate(newDate, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__DATE, newDate, newDate));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getAuthor() {
return author;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAuthor(Reference newAuthor, NotificationChain msgs) {
Reference oldAuthor = author;
author = newAuthor;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR, oldAuthor, newAuthor);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAuthor(Reference newAuthor) {
if (newAuthor != author) {
NotificationChain msgs = null;
if (author != null)
msgs = ((InternalEObject)author).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR, null, msgs);
if (newAuthor != null)
msgs = ((InternalEObject)newAuthor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR, null, msgs);
msgs = basicSetAuthor(newAuthor, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR, newAuthor, newAuthor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION:
return basicSetAction(null, msgs);
case FhirPackage.DETECTED_ISSUE_MITIGATION__DATE:
return basicSetDate(null, msgs);
case FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR:
return basicSetAuthor(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.DETECTED_ISSUE_MITIGATION__ACTION:
return getAction();
case FhirPackage.DETECTED_ISSUE_MITIGATION__DATE:
return getDate();
case FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR:
return getAuthor();
}
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.DETECTED_ISSUE_MITIGATION__ACTION:
setAction((CodeableConcept)newValue);
return;
case FhirPackage.DETECTED_ISSUE_MITIGATION__DATE:
setDate((DateTime)newValue);
return;
case FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR:
setAuthor((Reference)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION:
setAction((CodeableConcept)null);
return;
case FhirPackage.DETECTED_ISSUE_MITIGATION__DATE:
setDate((DateTime)null);
return;
case FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR:
setAuthor((Reference)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.DETECTED_ISSUE_MITIGATION__ACTION:
return action != null;
case FhirPackage.DETECTED_ISSUE_MITIGATION__DATE:
return date != null;
case FhirPackage.DETECTED_ISSUE_MITIGATION__AUTHOR:
return author != null;
}
return super.eIsSet(featureID);
}
} //DetectedIssueMitigationImpl