| /******************************************************************************* |
| * 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.Code; |
| 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.AppointmentParticipant; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| import org.eclipse.mdht.uml.fhir.core.resource.Resource; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Appointment Participant</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AppointmentParticipantImpl#getTypes <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AppointmentParticipantImpl#getActor <em>Actor</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AppointmentParticipantImpl#getRequired <em>Required</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AppointmentParticipantImpl#getStatus <em>Status</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AppointmentParticipantImpl extends BackboneElementImpl implements AppointmentParticipant { |
| /** |
| * The cached value of the '{@link #getTypes() <em>Type</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<CodeableConcept> types; |
| |
| /** |
| * The cached value of the '{@link #getActor() <em>Actor</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActor() |
| * @generated |
| * @ordered |
| */ |
| protected Resource actor; |
| |
| /** |
| * The cached value of the '{@link #getRequired() <em>Required</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRequired() |
| * @generated |
| * @ordered |
| */ |
| protected Code required; |
| |
| /** |
| * The cached value of the '{@link #getStatus() <em>Status</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getStatus() |
| * @generated |
| * @ordered |
| */ |
| protected Code status; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AppointmentParticipantImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getAppointmentParticipant(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<CodeableConcept> getTypes() { |
| if (types == null) { |
| types = new EObjectResolvingEList<CodeableConcept>(CodeableConcept.class, this, FhirResourcePackage.APPOINTMENT_PARTICIPANT__TYPE); |
| } |
| return types; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource getActor() { |
| if (actor != null && actor.eIsProxy()) { |
| InternalEObject oldActor = (InternalEObject)actor; |
| actor = (Resource)eResolveProxy(oldActor); |
| if (actor != oldActor) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR, oldActor, actor)); |
| } |
| } |
| return actor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Resource basicGetActor() { |
| return actor; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActor(Resource newActor) { |
| Resource oldActor = actor; |
| actor = newActor; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR, oldActor, actor)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getRequired() { |
| if (required != null && required.eIsProxy()) { |
| InternalEObject oldRequired = (InternalEObject)required; |
| required = (Code)eResolveProxy(oldRequired); |
| if (required != oldRequired) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED, oldRequired, required)); |
| } |
| } |
| return required; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetRequired() { |
| return required; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRequired(Code newRequired) { |
| Code oldRequired = required; |
| required = newRequired; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED, oldRequired, required)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getStatus() { |
| if (status != null && status.eIsProxy()) { |
| InternalEObject oldStatus = (InternalEObject)status; |
| status = (Code)eResolveProxy(oldStatus); |
| if (status != oldStatus) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS, oldStatus, status)); |
| } |
| } |
| return status; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetStatus() { |
| return status; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStatus(Code newStatus) { |
| Code oldStatus = status; |
| status = newStatus; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS, oldStatus, status)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__TYPE: |
| return getTypes(); |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| if (resolve) return getActor(); |
| return basicGetActor(); |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| if (resolve) return getRequired(); |
| return basicGetRequired(); |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS: |
| if (resolve) return getStatus(); |
| return basicGetStatus(); |
| } |
| 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.APPOINTMENT_PARTICIPANT__TYPE: |
| getTypes().clear(); |
| getTypes().addAll((Collection<? extends CodeableConcept>)newValue); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| setActor((Resource)newValue); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| setRequired((Code)newValue); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS: |
| setStatus((Code)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__TYPE: |
| getTypes().clear(); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| setActor((Resource)null); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| setRequired((Code)null); |
| return; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS: |
| setStatus((Code)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__TYPE: |
| return types != null && !types.isEmpty(); |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__ACTOR: |
| return actor != null; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__REQUIRED: |
| return required != null; |
| case FhirResourcePackage.APPOINTMENT_PARTICIPANT__STATUS: |
| return status != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //AppointmentParticipantImpl |