blob: 4852df54ee0d9a6e9cb908a009c29c79c91a7b56 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.hl7.fhir.CodeableConcept;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.InsurancePlanBenefit1;
import org.hl7.fhir.InsurancePlanSpecificCost;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Insurance Plan Specific Cost</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.InsurancePlanSpecificCostImpl#getCategory <em>Category</em>}</li>
* <li>{@link org.hl7.fhir.impl.InsurancePlanSpecificCostImpl#getBenefit <em>Benefit</em>}</li>
* </ul>
*
* @generated
*/
public class InsurancePlanSpecificCostImpl extends BackboneElementImpl implements InsurancePlanSpecificCost {
/**
* The cached value of the '{@link #getCategory() <em>Category</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCategory()
* @generated
* @ordered
*/
protected CodeableConcept category;
/**
* The cached value of the '{@link #getBenefit() <em>Benefit</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBenefit()
* @generated
* @ordered
*/
protected EList<InsurancePlanBenefit1> benefit;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InsurancePlanSpecificCostImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getInsurancePlanSpecificCost();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getCategory() {
return category;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCategory(CodeableConcept newCategory, NotificationChain msgs) {
CodeableConcept oldCategory = category;
category = newCategory;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY, oldCategory, newCategory);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCategory(CodeableConcept newCategory) {
if (newCategory != category) {
NotificationChain msgs = null;
if (category != null)
msgs = ((InternalEObject)category).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY, null, msgs);
if (newCategory != null)
msgs = ((InternalEObject)newCategory).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY, null, msgs);
msgs = basicSetCategory(newCategory, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY, newCategory, newCategory));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<InsurancePlanBenefit1> getBenefit() {
if (benefit == null) {
benefit = new EObjectContainmentEList<InsurancePlanBenefit1>(InsurancePlanBenefit1.class, this, FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT);
}
return benefit;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY:
return basicSetCategory(null, msgs);
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT:
return ((InternalEList<?>)getBenefit()).basicRemove(otherEnd, 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.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY:
return getCategory();
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT:
return getBenefit();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY:
setCategory((CodeableConcept)newValue);
return;
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT:
getBenefit().clear();
getBenefit().addAll((Collection<? extends InsurancePlanBenefit1>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY:
setCategory((CodeableConcept)null);
return;
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT:
getBenefit().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__CATEGORY:
return category != null;
case FhirPackage.INSURANCE_PLAN_SPECIFIC_COST__BENEFIT:
return benefit != null && !benefit.isEmpty();
}
return super.eIsSet(featureID);
}
} //InsurancePlanSpecificCostImpl