| /** |
| */ |
| 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.Coding; |
| import org.hl7.fhir.ConformanceEndpoint; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Uri; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Conformance Endpoint</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ConformanceEndpointImpl#getProtocol <em>Protocol</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ConformanceEndpointImpl#getAddress <em>Address</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ConformanceEndpointImpl extends BackboneElementImpl implements ConformanceEndpoint { |
| /** |
| * The cached value of the '{@link #getProtocol() <em>Protocol</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProtocol() |
| * @generated |
| * @ordered |
| */ |
| protected Coding protocol; |
| |
| /** |
| * The cached value of the '{@link #getAddress() <em>Address</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAddress() |
| * @generated |
| * @ordered |
| */ |
| protected Uri address; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ConformanceEndpointImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getConformanceEndpoint(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding getProtocol() { |
| return protocol; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetProtocol(Coding newProtocol, NotificationChain msgs) { |
| Coding oldProtocol = protocol; |
| protocol = newProtocol; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL, oldProtocol, newProtocol); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProtocol(Coding newProtocol) { |
| if (newProtocol != protocol) { |
| NotificationChain msgs = null; |
| if (protocol != null) |
| msgs = ((InternalEObject)protocol).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL, null, msgs); |
| if (newProtocol != null) |
| msgs = ((InternalEObject)newProtocol).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL, null, msgs); |
| msgs = basicSetProtocol(newProtocol, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL, newProtocol, newProtocol)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getAddress() { |
| return address; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetAddress(Uri newAddress, NotificationChain msgs) { |
| Uri oldAddress = address; |
| address = newAddress; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS, oldAddress, newAddress); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAddress(Uri newAddress) { |
| if (newAddress != address) { |
| NotificationChain msgs = null; |
| if (address != null) |
| msgs = ((InternalEObject)address).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS, null, msgs); |
| if (newAddress != null) |
| msgs = ((InternalEObject)newAddress).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS, null, msgs); |
| msgs = basicSetAddress(newAddress, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS, newAddress, newAddress)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL: |
| return basicSetProtocol(null, msgs); |
| case FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS: |
| return basicSetAddress(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.CONFORMANCE_ENDPOINT__PROTOCOL: |
| return getProtocol(); |
| case FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS: |
| return getAddress(); |
| } |
| 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.CONFORMANCE_ENDPOINT__PROTOCOL: |
| setProtocol((Coding)newValue); |
| return; |
| case FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS: |
| setAddress((Uri)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL: |
| setProtocol((Coding)null); |
| return; |
| case FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS: |
| setAddress((Uri)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CONFORMANCE_ENDPOINT__PROTOCOL: |
| return protocol != null; |
| case FhirPackage.CONFORMANCE_ENDPOINT__ADDRESS: |
| return address != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ConformanceEndpointImpl |