| /** |
| */ |
| 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.FhirPackage; |
| import org.hl7.fhir.TestScriptAction1; |
| import org.hl7.fhir.TestScriptMetadata; |
| import org.hl7.fhir.TestScriptTest; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Test Script Test</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.TestScriptTestImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.TestScriptTestImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.TestScriptTestImpl#getMetadata <em>Metadata</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.TestScriptTestImpl#getAction <em>Action</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class TestScriptTestImpl extends BackboneElementImpl implements TestScriptTest { |
| /** |
| * The cached value of the '{@link #getName() <em>Name</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getName() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String name; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String description; |
| |
| /** |
| * The cached value of the '{@link #getMetadata() <em>Metadata</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMetadata() |
| * @generated |
| * @ordered |
| */ |
| protected TestScriptMetadata metadata; |
| |
| /** |
| * The cached value of the '{@link #getAction() <em>Action</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAction() |
| * @generated |
| * @ordered |
| */ |
| protected EList<TestScriptAction1> action; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected TestScriptTestImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getTestScriptTest(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetName(org.hl7.fhir.String newName, NotificationChain msgs) { |
| org.hl7.fhir.String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__NAME, oldName, newName); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setName(org.hl7.fhir.String newName) { |
| if (newName != name) { |
| NotificationChain msgs = null; |
| if (name != null) |
| msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__NAME, null, msgs); |
| if (newName != null) |
| msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__NAME, null, msgs); |
| msgs = basicSetName(newName, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__NAME, newName, newName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetDescription(org.hl7.fhir.String newDescription, NotificationChain msgs) { |
| org.hl7.fhir.String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION, oldDescription, newDescription); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(org.hl7.fhir.String newDescription) { |
| if (newDescription != description) { |
| NotificationChain msgs = null; |
| if (description != null) |
| msgs = ((InternalEObject)description).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION, null, msgs); |
| if (newDescription != null) |
| msgs = ((InternalEObject)newDescription).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION, null, msgs); |
| msgs = basicSetDescription(newDescription, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION, newDescription, newDescription)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public TestScriptMetadata getMetadata() { |
| return metadata; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetMetadata(TestScriptMetadata newMetadata, NotificationChain msgs) { |
| TestScriptMetadata oldMetadata = metadata; |
| metadata = newMetadata; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__METADATA, oldMetadata, newMetadata); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMetadata(TestScriptMetadata newMetadata) { |
| if (newMetadata != metadata) { |
| NotificationChain msgs = null; |
| if (metadata != null) |
| msgs = ((InternalEObject)metadata).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__METADATA, null, msgs); |
| if (newMetadata != null) |
| msgs = ((InternalEObject)newMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_TEST__METADATA, null, msgs); |
| msgs = basicSetMetadata(newMetadata, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_TEST__METADATA, newMetadata, newMetadata)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<TestScriptAction1> getAction() { |
| if (action == null) { |
| action = new EObjectContainmentEList<TestScriptAction1>(TestScriptAction1.class, this, FhirPackage.TEST_SCRIPT_TEST__ACTION); |
| } |
| return action; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.TEST_SCRIPT_TEST__NAME: |
| return basicSetName(null, msgs); |
| case FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION: |
| return basicSetDescription(null, msgs); |
| case FhirPackage.TEST_SCRIPT_TEST__METADATA: |
| return basicSetMetadata(null, msgs); |
| case FhirPackage.TEST_SCRIPT_TEST__ACTION: |
| return ((InternalEList<?>)getAction()).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.TEST_SCRIPT_TEST__NAME: |
| return getName(); |
| case FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION: |
| return getDescription(); |
| case FhirPackage.TEST_SCRIPT_TEST__METADATA: |
| return getMetadata(); |
| case FhirPackage.TEST_SCRIPT_TEST__ACTION: |
| return getAction(); |
| } |
| 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.TEST_SCRIPT_TEST__NAME: |
| setName((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION: |
| setDescription((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__METADATA: |
| setMetadata((TestScriptMetadata)newValue); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__ACTION: |
| getAction().clear(); |
| getAction().addAll((Collection<? extends TestScriptAction1>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.TEST_SCRIPT_TEST__NAME: |
| setName((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION: |
| setDescription((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__METADATA: |
| setMetadata((TestScriptMetadata)null); |
| return; |
| case FhirPackage.TEST_SCRIPT_TEST__ACTION: |
| getAction().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.TEST_SCRIPT_TEST__NAME: |
| return name != null; |
| case FhirPackage.TEST_SCRIPT_TEST__DESCRIPTION: |
| return description != null; |
| case FhirPackage.TEST_SCRIPT_TEST__METADATA: |
| return metadata != null; |
| case FhirPackage.TEST_SCRIPT_TEST__ACTION: |
| return action != null && !action.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //TestScriptTestImpl |