| /** |
| */ |
| 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.Code; |
| import org.hl7.fhir.CompartmentDefinitionResource; |
| import org.hl7.fhir.FhirPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Compartment Definition Resource</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.CompartmentDefinitionResourceImpl#getCode <em>Code</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.CompartmentDefinitionResourceImpl#getParam <em>Param</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.CompartmentDefinitionResourceImpl#getDocumentation <em>Documentation</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CompartmentDefinitionResourceImpl extends BackboneElementImpl implements CompartmentDefinitionResource { |
| /** |
| * The cached value of the '{@link #getCode() <em>Code</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCode() |
| * @generated |
| * @ordered |
| */ |
| protected Code code; |
| |
| /** |
| * The cached value of the '{@link #getParam() <em>Param</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getParam() |
| * @generated |
| * @ordered |
| */ |
| protected EList<org.hl7.fhir.String> param; |
| |
| /** |
| * The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDocumentation() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String documentation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CompartmentDefinitionResourceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getCompartmentDefinitionResource(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getCode() { |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetCode(Code newCode, NotificationChain msgs) { |
| Code oldCode = code; |
| code = newCode; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE, oldCode, newCode); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCode(Code newCode) { |
| if (newCode != code) { |
| NotificationChain msgs = null; |
| if (code != null) |
| msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE, null, msgs); |
| if (newCode != null) |
| msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE, null, msgs); |
| msgs = basicSetCode(newCode, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE, newCode, newCode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<org.hl7.fhir.String> getParam() { |
| if (param == null) { |
| param = new EObjectContainmentEList<org.hl7.fhir.String>(org.hl7.fhir.String.class, this, FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM); |
| } |
| return param; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getDocumentation() { |
| return documentation; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDocumentation(org.hl7.fhir.String newDocumentation, NotificationChain msgs) { |
| org.hl7.fhir.String oldDocumentation = documentation; |
| documentation = newDocumentation; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION, oldDocumentation, newDocumentation); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDocumentation(org.hl7.fhir.String newDocumentation) { |
| if (newDocumentation != documentation) { |
| NotificationChain msgs = null; |
| if (documentation != null) |
| msgs = ((InternalEObject)documentation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION, null, msgs); |
| if (newDocumentation != null) |
| msgs = ((InternalEObject)newDocumentation).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION, null, msgs); |
| msgs = basicSetDocumentation(newDocumentation, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION, newDocumentation, newDocumentation)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE: |
| return basicSetCode(null, msgs); |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM: |
| return ((InternalEList<?>)getParam()).basicRemove(otherEnd, msgs); |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION: |
| return basicSetDocumentation(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.COMPARTMENT_DEFINITION_RESOURCE__CODE: |
| return getCode(); |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM: |
| return getParam(); |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION: |
| return getDocumentation(); |
| } |
| 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.COMPARTMENT_DEFINITION_RESOURCE__CODE: |
| setCode((Code)newValue); |
| return; |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM: |
| getParam().clear(); |
| getParam().addAll((Collection<? extends org.hl7.fhir.String>)newValue); |
| return; |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION: |
| setDocumentation((org.hl7.fhir.String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE: |
| setCode((Code)null); |
| return; |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM: |
| getParam().clear(); |
| return; |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION: |
| setDocumentation((org.hl7.fhir.String)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__CODE: |
| return code != null; |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__PARAM: |
| return param != null && !param.isEmpty(); |
| case FhirPackage.COMPARTMENT_DEFINITION_RESOURCE__DOCUMENTATION: |
| return documentation != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //CompartmentDefinitionResourceImpl |