| /******************************************************************************* |
| * 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.Coding; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Identifier; |
| |
| import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.AuditEventSource; |
| import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Audit Event Source</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AuditEventSourceImpl#getSite <em>Site</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AuditEventSourceImpl#getIdentifier <em>Identifier</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.AuditEventSourceImpl#getTypes <em>Type</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AuditEventSourceImpl extends BackboneElementImpl implements AuditEventSource { |
| /** |
| * The cached value of the '{@link #getSite() <em>Site</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSite() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String site; |
| |
| /** |
| * The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIdentifier() |
| * @generated |
| * @ordered |
| */ |
| protected Identifier identifier; |
| |
| /** |
| * The cached value of the '{@link #getTypes() <em>Type</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypes() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Coding> types; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AuditEventSourceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirResourcePackage.eINSTANCE.getAuditEventSource(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getSite() { |
| if (site != null && site.eIsProxy()) { |
| InternalEObject oldSite = (InternalEObject)site; |
| site = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldSite); |
| if (site != oldSite) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.AUDIT_EVENT_SOURCE__SITE, oldSite, site)); |
| } |
| } |
| return site; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetSite() { |
| return site; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSite(org.eclipse.mdht.uml.fhir.core.datatype.String newSite) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldSite = site; |
| site = newSite; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.AUDIT_EVENT_SOURCE__SITE, oldSite, site)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Identifier getIdentifier() { |
| if (identifier != null && identifier.eIsProxy()) { |
| InternalEObject oldIdentifier = (InternalEObject)identifier; |
| identifier = (Identifier)eResolveProxy(oldIdentifier); |
| if (identifier != oldIdentifier) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| } |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Identifier basicGetIdentifier() { |
| return identifier; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIdentifier(Identifier newIdentifier) { |
| Identifier oldIdentifier = identifier; |
| identifier = newIdentifier; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER, oldIdentifier, identifier)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Coding> getTypes() { |
| if (types == null) { |
| types = new EObjectResolvingEList<Coding>(Coding.class, this, FhirResourcePackage.AUDIT_EVENT_SOURCE__TYPE); |
| } |
| return types; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__SITE: |
| if (resolve) return getSite(); |
| return basicGetSite(); |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER: |
| if (resolve) return getIdentifier(); |
| return basicGetIdentifier(); |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__TYPE: |
| return getTypes(); |
| } |
| 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.AUDIT_EVENT_SOURCE__SITE: |
| setSite((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER: |
| setIdentifier((Identifier)newValue); |
| return; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__TYPE: |
| getTypes().clear(); |
| getTypes().addAll((Collection<? extends Coding>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__SITE: |
| setSite((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER: |
| setIdentifier((Identifier)null); |
| return; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__TYPE: |
| getTypes().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__SITE: |
| return site != null; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__IDENTIFIER: |
| return identifier != null; |
| case FhirResourcePackage.AUDIT_EVENT_SOURCE__TYPE: |
| return types != null && !types.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //AuditEventSourceImpl |