blob: a567c607e54e1dec2c0f77b4776b3c3de847f0f5 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
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.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.hl7.fhir.AuditEventSource;
import org.hl7.fhir.Coding;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Identifier;
/**
* <!-- 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.hl7.fhir.impl.AuditEventSourceImpl#getSite <em>Site</em>}</li>
* <li>{@link org.hl7.fhir.impl.AuditEventSourceImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.hl7.fhir.impl.AuditEventSourceImpl#getType <em>Type</em>}</li>
* </ul>
*
* @generated
*/
public class AuditEventSourceImpl extends BackboneElementImpl implements AuditEventSource {
/**
* The cached value of the '{@link #getSite() <em>Site</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSite()
* @generated
* @ordered
*/
protected org.hl7.fhir.String site;
/**
* The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifier()
* @generated
* @ordered
*/
protected Identifier identifier;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected EList<Coding> type;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AuditEventSourceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getAuditEventSource();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getSite() {
return site;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSite(org.hl7.fhir.String newSite, NotificationChain msgs) {
org.hl7.fhir.String oldSite = site;
site = newSite;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.AUDIT_EVENT_SOURCE__SITE, oldSite, newSite);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSite(org.hl7.fhir.String newSite) {
if (newSite != site) {
NotificationChain msgs = null;
if (site != null)
msgs = ((InternalEObject)site).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.AUDIT_EVENT_SOURCE__SITE, null, msgs);
if (newSite != null)
msgs = ((InternalEObject)newSite).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.AUDIT_EVENT_SOURCE__SITE, null, msgs);
msgs = basicSetSite(newSite, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.AUDIT_EVENT_SOURCE__SITE, newSite, newSite));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Identifier getIdentifier() {
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIdentifier(Identifier newIdentifier, NotificationChain msgs) {
Identifier oldIdentifier = identifier;
identifier = newIdentifier;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER, oldIdentifier, newIdentifier);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdentifier(Identifier newIdentifier) {
if (newIdentifier != identifier) {
NotificationChain msgs = null;
if (identifier != null)
msgs = ((InternalEObject)identifier).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER, null, msgs);
if (newIdentifier != null)
msgs = ((InternalEObject)newIdentifier).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER, null, msgs);
msgs = basicSetIdentifier(newIdentifier, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER, newIdentifier, newIdentifier));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Coding> getType() {
if (type == null) {
type = new EObjectContainmentEList<Coding>(Coding.class, this, FhirPackage.AUDIT_EVENT_SOURCE__TYPE);
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.AUDIT_EVENT_SOURCE__SITE:
return basicSetSite(null, msgs);
case FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER:
return basicSetIdentifier(null, msgs);
case FhirPackage.AUDIT_EVENT_SOURCE__TYPE:
return ((InternalEList<?>)getType()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirPackage.AUDIT_EVENT_SOURCE__SITE:
return getSite();
case FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER:
return getIdentifier();
case FhirPackage.AUDIT_EVENT_SOURCE__TYPE:
return getType();
}
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 FhirPackage.AUDIT_EVENT_SOURCE__SITE:
setSite((org.hl7.fhir.String)newValue);
return;
case FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER:
setIdentifier((Identifier)newValue);
return;
case FhirPackage.AUDIT_EVENT_SOURCE__TYPE:
getType().clear();
getType().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 FhirPackage.AUDIT_EVENT_SOURCE__SITE:
setSite((org.hl7.fhir.String)null);
return;
case FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER:
setIdentifier((Identifier)null);
return;
case FhirPackage.AUDIT_EVENT_SOURCE__TYPE:
getType().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.AUDIT_EVENT_SOURCE__SITE:
return site != null;
case FhirPackage.AUDIT_EVENT_SOURCE__IDENTIFIER:
return identifier != null;
case FhirPackage.AUDIT_EVENT_SOURCE__TYPE:
return type != null && !type.isEmpty();
}
return super.eIsSet(featureID);
}
} //AuditEventSourceImpl