blob: b36243d96ace949bd59c4aab50ff8b537ddae7bf [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.ActionConditionKind;
import org.hl7.fhir.Expression;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.RequestGroupCondition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Request Group Condition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.RequestGroupConditionImpl#getKind <em>Kind</em>}</li>
* <li>{@link org.hl7.fhir.impl.RequestGroupConditionImpl#getExpression <em>Expression</em>}</li>
* </ul>
*
* @generated
*/
public class RequestGroupConditionImpl extends BackboneElementImpl implements RequestGroupCondition {
/**
* The cached value of the '{@link #getKind() <em>Kind</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getKind()
* @generated
* @ordered
*/
protected ActionConditionKind kind;
/**
* The cached value of the '{@link #getExpression() <em>Expression</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getExpression()
* @generated
* @ordered
*/
protected Expression expression;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RequestGroupConditionImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getRequestGroupCondition();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActionConditionKind getKind() {
return kind;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetKind(ActionConditionKind newKind, NotificationChain msgs) {
ActionConditionKind oldKind = kind;
kind = newKind;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.REQUEST_GROUP_CONDITION__KIND, oldKind, newKind);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setKind(ActionConditionKind newKind) {
if (newKind != kind) {
NotificationChain msgs = null;
if (kind != null)
msgs = ((InternalEObject)kind).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REQUEST_GROUP_CONDITION__KIND, null, msgs);
if (newKind != null)
msgs = ((InternalEObject)newKind).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REQUEST_GROUP_CONDITION__KIND, null, msgs);
msgs = basicSetKind(newKind, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REQUEST_GROUP_CONDITION__KIND, newKind, newKind));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Expression getExpression() {
return expression;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
Expression oldExpression = expression;
expression = newExpression;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION, oldExpression, newExpression);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExpression(Expression newExpression) {
if (newExpression != expression) {
NotificationChain msgs = null;
if (expression != null)
msgs = ((InternalEObject)expression).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION, null, msgs);
if (newExpression != null)
msgs = ((InternalEObject)newExpression).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION, null, msgs);
msgs = basicSetExpression(newExpression, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION, newExpression, newExpression));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.REQUEST_GROUP_CONDITION__KIND:
return basicSetKind(null, msgs);
case FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION:
return basicSetExpression(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.REQUEST_GROUP_CONDITION__KIND:
return getKind();
case FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION:
return getExpression();
}
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.REQUEST_GROUP_CONDITION__KIND:
setKind((ActionConditionKind)newValue);
return;
case FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION:
setExpression((Expression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.REQUEST_GROUP_CONDITION__KIND:
setKind((ActionConditionKind)null);
return;
case FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION:
setExpression((Expression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.REQUEST_GROUP_CONDITION__KIND:
return kind != null;
case FhirPackage.REQUEST_GROUP_CONDITION__EXPRESSION:
return expression != null;
}
return super.eIsSet(featureID);
}
} //RequestGroupConditionImpl