| /******************************************************************************* |
| * 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.datatype.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.CodeableConcept; |
| import org.eclipse.mdht.uml.fhir.core.datatype.FhirDatatypePackage; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Identifier; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Period; |
| import org.eclipse.mdht.uml.fhir.core.datatype.Uri; |
| |
| import org.eclipse.mdht.uml.fhir.core.resource.Organization; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Identifier</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getUse <em>Use</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getSystem <em>System</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getValue <em>Value</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getPeriod <em>Period</em>}</li> |
| * <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.IdentifierImpl#getAssigner <em>Assigner</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class IdentifierImpl extends DataTypeImpl implements Identifier { |
| /** |
| * The cached value of the '{@link #getUse() <em>Use</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUse() |
| * @generated |
| * @ordered |
| */ |
| protected Code use; |
| |
| /** |
| * 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 #getSystem() <em>System</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSystem() |
| * @generated |
| * @ordered |
| */ |
| protected Uri system; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected org.eclipse.mdht.uml.fhir.core.datatype.String value; |
| |
| /** |
| * The cached value of the '{@link #getPeriod() <em>Period</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPeriod() |
| * @generated |
| * @ordered |
| */ |
| protected Period period; |
| |
| /** |
| * The cached value of the '{@link #getAssigner() <em>Assigner</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAssigner() |
| * @generated |
| * @ordered |
| */ |
| protected Organization assigner; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected IdentifierImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirDatatypePackage.Literals.IDENTIFIER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code getUse() { |
| if (use != null && use.eIsProxy()) { |
| InternalEObject oldUse = (InternalEObject)use; |
| use = (Code)eResolveProxy(oldUse); |
| if (use != oldUse) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.IDENTIFIER__USE, oldUse, use)); |
| } |
| } |
| return use; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Code basicGetUse() { |
| return use; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUse(Code newUse) { |
| Code oldUse = use; |
| use = newUse; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.IDENTIFIER__USE, oldUse, use)); |
| } |
| |
| /** |
| * <!-- 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, FhirDatatypePackage.IDENTIFIER__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, FhirDatatypePackage.IDENTIFIER__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri getSystem() { |
| if (system != null && system.eIsProxy()) { |
| InternalEObject oldSystem = (InternalEObject)system; |
| system = (Uri)eResolveProxy(oldSystem); |
| if (system != oldSystem) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.IDENTIFIER__SYSTEM, oldSystem, system)); |
| } |
| } |
| return system; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Uri basicGetSystem() { |
| return system; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSystem(Uri newSystem) { |
| Uri oldSystem = system; |
| system = newSystem; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.IDENTIFIER__SYSTEM, oldSystem, system)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String getValue() { |
| if (value != null && value.eIsProxy()) { |
| InternalEObject oldValue = (InternalEObject)value; |
| value = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldValue); |
| if (value != oldValue) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.IDENTIFIER__VALUE, oldValue, value)); |
| } |
| } |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValue(org.eclipse.mdht.uml.fhir.core.datatype.String newValue) { |
| org.eclipse.mdht.uml.fhir.core.datatype.String oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.IDENTIFIER__VALUE, oldValue, value)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period getPeriod() { |
| if (period != null && period.eIsProxy()) { |
| InternalEObject oldPeriod = (InternalEObject)period; |
| period = (Period)eResolveProxy(oldPeriod); |
| if (period != oldPeriod) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.IDENTIFIER__PERIOD, oldPeriod, period)); |
| } |
| } |
| return period; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period basicGetPeriod() { |
| return period; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPeriod(Period newPeriod) { |
| Period oldPeriod = period; |
| period = newPeriod; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.IDENTIFIER__PERIOD, oldPeriod, period)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Organization getAssigner() { |
| if (assigner != null && assigner.eIsProxy()) { |
| InternalEObject oldAssigner = (InternalEObject)assigner; |
| assigner = (Organization)eResolveProxy(oldAssigner); |
| if (assigner != oldAssigner) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.IDENTIFIER__ASSIGNER, oldAssigner, assigner)); |
| } |
| } |
| return assigner; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Organization basicGetAssigner() { |
| return assigner; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAssigner(Organization newAssigner) { |
| Organization oldAssigner = assigner; |
| assigner = newAssigner; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.IDENTIFIER__ASSIGNER, oldAssigner, assigner)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FhirDatatypePackage.IDENTIFIER__USE: |
| if (resolve) return getUse(); |
| return basicGetUse(); |
| case FhirDatatypePackage.IDENTIFIER__TYPE: |
| if (resolve) return getType(); |
| return basicGetType(); |
| case FhirDatatypePackage.IDENTIFIER__SYSTEM: |
| if (resolve) return getSystem(); |
| return basicGetSystem(); |
| case FhirDatatypePackage.IDENTIFIER__VALUE: |
| if (resolve) return getValue(); |
| return basicGetValue(); |
| case FhirDatatypePackage.IDENTIFIER__PERIOD: |
| if (resolve) return getPeriod(); |
| return basicGetPeriod(); |
| case FhirDatatypePackage.IDENTIFIER__ASSIGNER: |
| if (resolve) return getAssigner(); |
| return basicGetAssigner(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FhirDatatypePackage.IDENTIFIER__USE: |
| setUse((Code)newValue); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__TYPE: |
| setType((CodeableConcept)newValue); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__SYSTEM: |
| setSystem((Uri)newValue); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__VALUE: |
| setValue((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__PERIOD: |
| setPeriod((Period)newValue); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__ASSIGNER: |
| setAssigner((Organization)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.IDENTIFIER__USE: |
| setUse((Code)null); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__TYPE: |
| setType((CodeableConcept)null); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__SYSTEM: |
| setSystem((Uri)null); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__VALUE: |
| setValue((org.eclipse.mdht.uml.fhir.core.datatype.String)null); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__PERIOD: |
| setPeriod((Period)null); |
| return; |
| case FhirDatatypePackage.IDENTIFIER__ASSIGNER: |
| setAssigner((Organization)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirDatatypePackage.IDENTIFIER__USE: |
| return use != null; |
| case FhirDatatypePackage.IDENTIFIER__TYPE: |
| return type != null; |
| case FhirDatatypePackage.IDENTIFIER__SYSTEM: |
| return system != null; |
| case FhirDatatypePackage.IDENTIFIER__VALUE: |
| return value != null; |
| case FhirDatatypePackage.IDENTIFIER__PERIOD: |
| return period != null; |
| case FhirDatatypePackage.IDENTIFIER__ASSIGNER: |
| return assigner != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //IdentifierImpl |