| /******************************************************************************* |
| * 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.Code; |
| 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.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.SubscriptionChannel; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Subscription Channel</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.SubscriptionChannelImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.SubscriptionChannelImpl#getEndpoint <em>Endpoint</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.SubscriptionChannelImpl#getPayload <em>Payload</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.SubscriptionChannelImpl#getHeader <em>Header</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class SubscriptionChannelImpl extends BackboneElementImpl implements SubscriptionChannel { |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected Code type; |
| |
| /** |
| * The cached value of the '{@link #getEndpoint() <em>Endpoint</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getEndpoint() |
| * @generated |
| * @ordered |
| */ |
| protected Uri endpoint; |
| |
| /** |
| * The cached value of the '{@link #getPayload() <em>Payload</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPayload() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String payload; |
| |
| /** |
| * The cached value of the '{@link #getHeader() <em>Header</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getHeader() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String header; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected SubscriptionChannelImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getSubscriptionChannel(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getType() { |
| if (type != null && type.eIsProxy()) { |
| InternalEObject oldType = (InternalEObject)type; |
| type = (Code)eResolveProxy(oldType); |
| if (type != oldType) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SUBSCRIPTION_CHANNEL__TYPE, oldType, type)); |
| } |
| } |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(Code newType) { |
| Code oldType = type; |
| type = newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SUBSCRIPTION_CHANNEL__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getEndpoint() { |
| if (endpoint != null && endpoint.eIsProxy()) { |
| InternalEObject oldEndpoint = (InternalEObject)endpoint; |
| endpoint = (Uri)eResolveProxy(oldEndpoint); |
| if (endpoint != oldEndpoint) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT, oldEndpoint, endpoint)); |
| } |
| } |
| return endpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri basicGetEndpoint() { |
| return endpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEndpoint(Uri newEndpoint) { |
| Uri oldEndpoint = endpoint; |
| endpoint = newEndpoint; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT, oldEndpoint, endpoint)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getPayload() { |
| if (payload != null && payload.eIsProxy()) { |
| InternalEObject oldPayload = (InternalEObject)payload; |
| payload = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldPayload); |
| if (payload != oldPayload) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD, oldPayload, payload)); |
| } |
| } |
| return payload; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetPayload() { |
| return payload; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPayload(org.eclipse.mdht.uml.fhir.core.datatype.String newPayload) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldPayload = payload; |
| payload = newPayload; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD, oldPayload, payload)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getHeader() { |
| if (header != null && header.eIsProxy()) { |
| InternalEObject oldHeader = (InternalEObject)header; |
| header = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldHeader); |
| if (header != oldHeader) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER, oldHeader, header)); |
| } |
| } |
| return header; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetHeader() { |
| return header; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setHeader(org.eclipse.mdht.uml.fhir.core.datatype.String newHeader) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldHeader = header; |
| header = newHeader; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER, oldHeader, header)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__TYPE: |
| if (resolve) return getType(); |
| return basicGetType(); |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT: |
| if (resolve) return getEndpoint(); |
| return basicGetEndpoint(); |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD: |
| if (resolve) return getPayload(); |
| return basicGetPayload(); |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER: |
| if (resolve) return getHeader(); |
| return basicGetHeader(); |
| } |
| 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.SUBSCRIPTION_CHANNEL__TYPE: |
| setType((Code)newValue); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT: |
| setEndpoint((Uri)newValue); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD: |
| setPayload((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER: |
| setHeader((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__TYPE: |
| setType((Code)null); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT: |
| setEndpoint((Uri)null); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD: |
| setPayload((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER: |
| setHeader((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__TYPE: |
| return type != null; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__ENDPOINT: |
| return endpoint != null; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__PAYLOAD: |
| return payload != null; |
| case FhirResourcePackage.SUBSCRIPTION_CHANNEL__HEADER: |
| return header != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //SubscriptionChannelImpl |