| /******************************************************************************* |
| * Copyright (c) 2016 David Carlson and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * David Carlson (Clinical Cloud Solutions, LLC) - initial API and implementation |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.mdht.uml.fhir.core.resource.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.Coding; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Uri; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.ConformanceMessagingEndpoint; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Conformance Messaging Endpoint</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ConformanceMessagingEndpointImpl#getProtocol <em>Protocol</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.ConformanceMessagingEndpointImpl#getAddress <em>Address</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ConformanceMessagingEndpointImpl extends BackboneElementImpl implements ConformanceMessagingEndpoint { |
| /** |
| * The cached value of the '{@link #getProtocol() <em>Protocol</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getProtocol() |
| * @generated |
| * @ordered |
| */ |
| protected Coding protocol; |
| |
| /** |
| * The cached value of the '{@link #getAddress() <em>Address</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAddress() |
| * @generated |
| * @ordered |
| */ |
| protected Uri address; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ConformanceMessagingEndpointImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getConformanceMessagingEndpoint(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding getProtocol() { |
| if (protocol != null && protocol.eIsProxy()) { |
| InternalEObject oldProtocol = (InternalEObject)protocol; |
| protocol = (Coding)eResolveProxy(oldProtocol); |
| if (protocol != oldProtocol) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL, oldProtocol, protocol)); |
| } |
| } |
| return protocol; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Coding basicGetProtocol() { |
| return protocol; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setProtocol(Coding newProtocol) { |
| Coding oldProtocol = protocol; |
| protocol = newProtocol; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL, oldProtocol, protocol)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getAddress() { |
| if (address != null && address.eIsProxy()) { |
| InternalEObject oldAddress = (InternalEObject)address; |
| address = (Uri)eResolveProxy(oldAddress); |
| if (address != oldAddress) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__ADDRESS, oldAddress, address)); |
| } |
| } |
| return address; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri basicGetAddress() { |
| return address; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAddress(Uri newAddress) { |
| Uri oldAddress = address; |
| address = newAddress; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__ADDRESS, oldAddress, address)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL: |
| if (resolve) return getProtocol(); |
| return basicGetProtocol(); |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__ADDRESS: |
| if (resolve) return getAddress(); |
| return basicGetAddress(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL: |
| setProtocol((Coding)newValue); |
| return; |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_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 FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL: |
| setProtocol((Coding)null); |
| return; |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_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 FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__PROTOCOL: |
| return protocol != null; |
| case FhirResourcePackage.CONFORMANCE_MESSAGING_ENDPOINT__ADDRESS: |
| return address != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ConformanceMessagingEndpointImpl |