blob: da83164affaafb226f3c5e063373b13a7c79ee41 [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.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.ContactPoint;
import org.eclipse.mdht.uml.fhir.core.datatype.FhirDatatypePackage;
import org.eclipse.mdht.uml.fhir.core.datatype.Period;
import org.eclipse.mdht.uml.fhir.core.datatype.PositiveInt;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Contact Point</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ContactPointImpl#getSystem <em>System</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ContactPointImpl#getValue <em>Value</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ContactPointImpl#getUse <em>Use</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ContactPointImpl#getRank <em>Rank</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.datatype.impl.ContactPointImpl#getPeriod <em>Period</em>}</li>
* </ul>
*
* @generated
*/
public class ContactPointImpl extends DataTypeImpl implements ContactPoint {
/**
* The cached value of the '{@link #getSystem() <em>System</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSystem()
* @generated
* @ordered
*/
protected Code 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 #getUse() <em>Use</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUse()
* @generated
* @ordered
*/
protected Code use;
/**
* The cached value of the '{@link #getRank() <em>Rank</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRank()
* @generated
* @ordered
*/
protected PositiveInt rank;
/**
* The cached value of the '{@link #getPeriod() <em>Period</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPeriod()
* @generated
* @ordered
*/
protected Period period;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ContactPointImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirDatatypePackage.Literals.CONTACT_POINT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getSystem() {
if (system != null && system.eIsProxy()) {
InternalEObject oldSystem = (InternalEObject)system;
system = (Code)eResolveProxy(oldSystem);
if (system != oldSystem) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.CONTACT_POINT__SYSTEM, oldSystem, system));
}
}
return system;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetSystem() {
return system;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSystem(Code newSystem) {
Code oldSystem = system;
system = newSystem;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.CONTACT_POINT__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.CONTACT_POINT__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.CONTACT_POINT__VALUE, oldValue, value));
}
/**
* <!-- 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.CONTACT_POINT__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.CONTACT_POINT__USE, oldUse, use));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositiveInt getRank() {
if (rank != null && rank.eIsProxy()) {
InternalEObject oldRank = (InternalEObject)rank;
rank = (PositiveInt)eResolveProxy(oldRank);
if (rank != oldRank) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirDatatypePackage.CONTACT_POINT__RANK, oldRank, rank));
}
}
return rank;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PositiveInt basicGetRank() {
return rank;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRank(PositiveInt newRank) {
PositiveInt oldRank = rank;
rank = newRank;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirDatatypePackage.CONTACT_POINT__RANK, oldRank, rank));
}
/**
* <!-- 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.CONTACT_POINT__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.CONTACT_POINT__PERIOD, oldPeriod, period));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirDatatypePackage.CONTACT_POINT__SYSTEM:
if (resolve) return getSystem();
return basicGetSystem();
case FhirDatatypePackage.CONTACT_POINT__VALUE:
if (resolve) return getValue();
return basicGetValue();
case FhirDatatypePackage.CONTACT_POINT__USE:
if (resolve) return getUse();
return basicGetUse();
case FhirDatatypePackage.CONTACT_POINT__RANK:
if (resolve) return getRank();
return basicGetRank();
case FhirDatatypePackage.CONTACT_POINT__PERIOD:
if (resolve) return getPeriod();
return basicGetPeriod();
}
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.CONTACT_POINT__SYSTEM:
setSystem((Code)newValue);
return;
case FhirDatatypePackage.CONTACT_POINT__VALUE:
setValue((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirDatatypePackage.CONTACT_POINT__USE:
setUse((Code)newValue);
return;
case FhirDatatypePackage.CONTACT_POINT__RANK:
setRank((PositiveInt)newValue);
return;
case FhirDatatypePackage.CONTACT_POINT__PERIOD:
setPeriod((Period)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirDatatypePackage.CONTACT_POINT__SYSTEM:
setSystem((Code)null);
return;
case FhirDatatypePackage.CONTACT_POINT__VALUE:
setValue((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirDatatypePackage.CONTACT_POINT__USE:
setUse((Code)null);
return;
case FhirDatatypePackage.CONTACT_POINT__RANK:
setRank((PositiveInt)null);
return;
case FhirDatatypePackage.CONTACT_POINT__PERIOD:
setPeriod((Period)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirDatatypePackage.CONTACT_POINT__SYSTEM:
return system != null;
case FhirDatatypePackage.CONTACT_POINT__VALUE:
return value != null;
case FhirDatatypePackage.CONTACT_POINT__USE:
return use != null;
case FhirDatatypePackage.CONTACT_POINT__RANK:
return rank != null;
case FhirDatatypePackage.CONTACT_POINT__PERIOD:
return period != null;
}
return super.eIsSet(featureID);
}
} //ContactPointImpl