blob: baafb18f717e1280cb1486ccf3802f2a2a78db67 [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 java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.mdht.uml.fhir.core.datatype.CodeableConcept;
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.HealthcareServiceServiceType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Healthcare Service Service Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.HealthcareServiceServiceTypeImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.HealthcareServiceServiceTypeImpl#getSpecialties <em>Specialty</em>}</li>
* </ul>
*
* @generated
*/
public class HealthcareServiceServiceTypeImpl extends BackboneElementImpl implements HealthcareServiceServiceType {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected CodeableConcept type;
/**
* The cached value of the '{@link #getSpecialties() <em>Specialty</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSpecialties()
* @generated
* @ordered
*/
protected EList<CodeableConcept> specialties;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected HealthcareServiceServiceTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getHealthcareServiceServiceType();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (CodeableConcept)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(CodeableConcept newType) {
CodeableConcept oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<CodeableConcept> getSpecialties() {
if (specialties == null) {
specialties = new EObjectResolvingEList<CodeableConcept>(CodeableConcept.class, this, FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__SPECIALTY);
}
return specialties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE:
if (resolve) return getType();
return basicGetType();
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__SPECIALTY:
return getSpecialties();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE:
setType((CodeableConcept)newValue);
return;
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__SPECIALTY:
getSpecialties().clear();
getSpecialties().addAll((Collection<? extends CodeableConcept>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE:
setType((CodeableConcept)null);
return;
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__SPECIALTY:
getSpecialties().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__TYPE:
return type != null;
case FhirResourcePackage.HEALTHCARE_SERVICE_SERVICE_TYPE__SPECIALTY:
return specialties != null && !specialties.isEmpty();
}
return super.eIsSet(featureID);
}
} //HealthcareServiceServiceTypeImpl