| /******************************************************************************* |
| * 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.Id; |
| |
| 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.MessageHeaderResponse; |
| import org.eclipse.mdht.uml.fhir.core.resource.OperationOutcome; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Message Header Response</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderResponseImpl#getIdentifier <em>Identifier</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderResponseImpl#getCode <em>Code</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderResponseImpl#getDetails <em>Details</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class MessageHeaderResponseImpl extends BackboneElementImpl implements MessageHeaderResponse { |
| /** |
| * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected Id identifier; |
| |
| /** |
| * The cached value of the '{@link #getCode() <em>Code</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCode() |
| * @generated |
| * @ordered |
| */ |
| protected Code code; |
| |
| /** |
| * The cached value of the '{@link #getDetails() <em>Details</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDetails() |
| * @generated |
| * @ordered |
| */ |
| protected OperationOutcome details; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected MessageHeaderResponseImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getMessageHeaderResponse(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Id getIdentifier() { |
| if (identifier != null && identifier.eIsProxy()) { |
| InternalEObject oldIdentifier = (InternalEObject)identifier; |
| identifier = (Id)eResolveProxy(oldIdentifier); |
| if (identifier != oldIdentifier) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| } |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Id basicGetIdentifier() { |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIdentifier(Id newIdentifier) { |
| Id oldIdentifier = identifier; |
| identifier = newIdentifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getCode() { |
| if (code != null && code.eIsProxy()) { |
| InternalEObject oldCode = (InternalEObject)code; |
| code = (Code)eResolveProxy(oldCode); |
| if (code != oldCode) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE, oldCode, code)); |
| } |
| } |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetCode() { |
| return code; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCode(Code newCode) { |
| Code oldCode = code; |
| code = newCode; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE, oldCode, code)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OperationOutcome getDetails() { |
| if (details != null && details.eIsProxy()) { |
| InternalEObject oldDetails = (InternalEObject)details; |
| details = (OperationOutcome)eResolveProxy(oldDetails); |
| if (details != oldDetails) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS, oldDetails, details)); |
| } |
| } |
| return details; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OperationOutcome basicGetDetails() { |
| return details; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDetails(OperationOutcome newDetails) { |
| OperationOutcome oldDetails = details; |
| details = newDetails; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS, oldDetails, details)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__IDENTIFIER: |
| if (resolve) return getIdentifier(); |
| return basicGetIdentifier(); |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE: |
| if (resolve) return getCode(); |
| return basicGetCode(); |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS: |
| if (resolve) return getDetails(); |
| return basicGetDetails(); |
| } |
| 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.MESSAGE_HEADER_RESPONSE__IDENTIFIER: |
| setIdentifier((Id)newValue); |
| return; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE: |
| setCode((Code)newValue); |
| return; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS: |
| setDetails((OperationOutcome)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__IDENTIFIER: |
| setIdentifier((Id)null); |
| return; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE: |
| setCode((Code)null); |
| return; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS: |
| setDetails((OperationOutcome)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__IDENTIFIER: |
| return identifier != null; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__CODE: |
| return code != null; |
| case FhirResourcePackage.MESSAGE_HEADER_RESPONSE__DETAILS: |
| return details != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //MessageHeaderResponseImpl |