blob: c14920ff099072d0798f4f4aa618e13dadbf1a8a [file] [log] [blame]
/*******************************************************************************
* 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.Uri;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.Device;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.MessageHeaderMessageDestination;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Message Header Message Destination</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderMessageDestinationImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderMessageDestinationImpl#getTarget <em>Target</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.MessageHeaderMessageDestinationImpl#getEndpoint <em>Endpoint</em>}</li>
* </ul>
*
* @generated
*/
public class MessageHeaderMessageDestinationImpl extends BackboneElementImpl implements MessageHeaderMessageDestination {
/**
* The cached value of the '{@link #getName() <em>Name</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String name;
/**
* The cached value of the '{@link #getTarget() <em>Target</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTarget()
* @generated
* @ordered
*/
protected Device target;
/**
* The cached value of the '{@link #getEndpoint() <em>Endpoint</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEndpoint()
* @generated
* @ordered
*/
protected Uri endpoint;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MessageHeaderMessageDestinationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getMessageHeaderMessageDestination();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getName() {
if (name != null && name.eIsProxy()) {
InternalEObject oldName = (InternalEObject)name;
name = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldName);
if (name != oldName) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__NAME, oldName, name));
}
}
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(org.eclipse.mdht.uml.fhir.core.datatype.String newName) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Device getTarget() {
if (target != null && target.eIsProxy()) {
InternalEObject oldTarget = (InternalEObject)target;
target = (Device)eResolveProxy(oldTarget);
if (target != oldTarget) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET, oldTarget, target));
}
}
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Device basicGetTarget() {
return target;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTarget(Device newTarget) {
Device oldTarget = target;
target = newTarget;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET, oldTarget, target));
}
/**
* <!-- 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.MESSAGE_HEADER_MESSAGE_DESTINATION__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.MESSAGE_HEADER_MESSAGE_DESTINATION__ENDPOINT, oldEndpoint, endpoint));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__NAME:
if (resolve) return getName();
return basicGetName();
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET:
if (resolve) return getTarget();
return basicGetTarget();
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__ENDPOINT:
if (resolve) return getEndpoint();
return basicGetEndpoint();
}
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_MESSAGE_DESTINATION__NAME:
setName((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET:
setTarget((Device)newValue);
return;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__ENDPOINT:
setEndpoint((Uri)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_MESSAGE_DESTINATION__NAME:
setName((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET:
setTarget((Device)null);
return;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__ENDPOINT:
setEndpoint((Uri)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__NAME:
return name != null;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__TARGET:
return target != null;
case FhirResourcePackage.MESSAGE_HEADER_MESSAGE_DESTINATION__ENDPOINT:
return endpoint != null;
}
return super.eIsSet(featureID);
}
} //MessageHeaderMessageDestinationImpl