blob: d30fc182d8100ae1fbf9b91cc26e90cab6ec8b6b [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.FhirPackage;
import org.hl7.fhir.Id;
import org.hl7.fhir.TestScriptVariable;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Test Script Variable</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.TestScriptVariableImpl#getName <em>Name</em>}</li>
* <li>{@link org.hl7.fhir.impl.TestScriptVariableImpl#getDefaultValue <em>Default Value</em>}</li>
* <li>{@link org.hl7.fhir.impl.TestScriptVariableImpl#getHeaderField <em>Header Field</em>}</li>
* <li>{@link org.hl7.fhir.impl.TestScriptVariableImpl#getPath <em>Path</em>}</li>
* <li>{@link org.hl7.fhir.impl.TestScriptVariableImpl#getSourceId <em>Source Id</em>}</li>
* </ul>
*
* @generated
*/
public class TestScriptVariableImpl extends BackboneElementImpl implements TestScriptVariable {
/**
* 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 #getDefaultValue() <em>Default Value</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDefaultValue()
* @generated
* @ordered
*/
protected org.hl7.fhir.String defaultValue;
/**
* The cached value of the '{@link #getHeaderField() <em>Header Field</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHeaderField()
* @generated
* @ordered
*/
protected org.hl7.fhir.String headerField;
/**
* The cached value of the '{@link #getPath() <em>Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPath()
* @generated
* @ordered
*/
protected org.hl7.fhir.String path;
/**
* The cached value of the '{@link #getSourceId() <em>Source Id</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSourceId()
* @generated
* @ordered
*/
protected Id sourceId;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TestScriptVariableImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getTestScriptVariable();
}
/**
* <!-- 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_VARIABLE__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_VARIABLE__NAME, null, msgs);
if (newName != null)
msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__NAME, null, msgs);
msgs = basicSetName(newName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__NAME, newName, newName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getDefaultValue() {
return defaultValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDefaultValue(org.hl7.fhir.String newDefaultValue, NotificationChain msgs) {
org.hl7.fhir.String oldDefaultValue = defaultValue;
defaultValue = newDefaultValue;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE, oldDefaultValue, newDefaultValue);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefaultValue(org.hl7.fhir.String newDefaultValue) {
if (newDefaultValue != defaultValue) {
NotificationChain msgs = null;
if (defaultValue != null)
msgs = ((InternalEObject)defaultValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE, null, msgs);
if (newDefaultValue != null)
msgs = ((InternalEObject)newDefaultValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE, null, msgs);
msgs = basicSetDefaultValue(newDefaultValue, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE, newDefaultValue, newDefaultValue));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getHeaderField() {
return headerField;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetHeaderField(org.hl7.fhir.String newHeaderField, NotificationChain msgs) {
org.hl7.fhir.String oldHeaderField = headerField;
headerField = newHeaderField;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD, oldHeaderField, newHeaderField);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHeaderField(org.hl7.fhir.String newHeaderField) {
if (newHeaderField != headerField) {
NotificationChain msgs = null;
if (headerField != null)
msgs = ((InternalEObject)headerField).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD, null, msgs);
if (newHeaderField != null)
msgs = ((InternalEObject)newHeaderField).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD, null, msgs);
msgs = basicSetHeaderField(newHeaderField, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD, newHeaderField, newHeaderField));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getPath() {
return path;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPath(org.hl7.fhir.String newPath, NotificationChain msgs) {
org.hl7.fhir.String oldPath = path;
path = newPath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__PATH, oldPath, newPath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPath(org.hl7.fhir.String newPath) {
if (newPath != path) {
NotificationChain msgs = null;
if (path != null)
msgs = ((InternalEObject)path).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__PATH, null, msgs);
if (newPath != null)
msgs = ((InternalEObject)newPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__PATH, null, msgs);
msgs = basicSetPath(newPath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__PATH, newPath, newPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Id getSourceId() {
return sourceId;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSourceId(Id newSourceId, NotificationChain msgs) {
Id oldSourceId = sourceId;
sourceId = newSourceId;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID, oldSourceId, newSourceId);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSourceId(Id newSourceId) {
if (newSourceId != sourceId) {
NotificationChain msgs = null;
if (sourceId != null)
msgs = ((InternalEObject)sourceId).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID, null, msgs);
if (newSourceId != null)
msgs = ((InternalEObject)newSourceId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID, null, msgs);
msgs = basicSetSourceId(newSourceId, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID, newSourceId, newSourceId));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.TEST_SCRIPT_VARIABLE__NAME:
return basicSetName(null, msgs);
case FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE:
return basicSetDefaultValue(null, msgs);
case FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD:
return basicSetHeaderField(null, msgs);
case FhirPackage.TEST_SCRIPT_VARIABLE__PATH:
return basicSetPath(null, msgs);
case FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID:
return basicSetSourceId(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.TEST_SCRIPT_VARIABLE__NAME:
return getName();
case FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE:
return getDefaultValue();
case FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD:
return getHeaderField();
case FhirPackage.TEST_SCRIPT_VARIABLE__PATH:
return getPath();
case FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID:
return getSourceId();
}
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.TEST_SCRIPT_VARIABLE__NAME:
setName((org.hl7.fhir.String)newValue);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE:
setDefaultValue((org.hl7.fhir.String)newValue);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD:
setHeaderField((org.hl7.fhir.String)newValue);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__PATH:
setPath((org.hl7.fhir.String)newValue);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID:
setSourceId((Id)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_VARIABLE__NAME:
setName((org.hl7.fhir.String)null);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE:
setDefaultValue((org.hl7.fhir.String)null);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD:
setHeaderField((org.hl7.fhir.String)null);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__PATH:
setPath((org.hl7.fhir.String)null);
return;
case FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID:
setSourceId((Id)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.TEST_SCRIPT_VARIABLE__NAME:
return name != null;
case FhirPackage.TEST_SCRIPT_VARIABLE__DEFAULT_VALUE:
return defaultValue != null;
case FhirPackage.TEST_SCRIPT_VARIABLE__HEADER_FIELD:
return headerField != null;
case FhirPackage.TEST_SCRIPT_VARIABLE__PATH:
return path != null;
case FhirPackage.TEST_SCRIPT_VARIABLE__SOURCE_ID:
return sourceId != null;
}
return super.eIsSet(featureID);
}
} //TestScriptVariableImpl