blob: aeb5605212b637e751371f048303990bb3b8609a [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.resource.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.Period;
import org.eclipse.mdht.uml.fhir.core.datatype.impl.BackboneElementImpl;
import org.eclipse.mdht.uml.fhir.core.resource.FhirResourcePackage;
import org.eclipse.mdht.uml.fhir.core.resource.GroupMember;
import org.eclipse.mdht.uml.fhir.core.resource.Resource;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Group Member</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.GroupMemberImpl#getEntity <em>Entity</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.GroupMemberImpl#getPeriod <em>Period</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.GroupMemberImpl#getInactive <em>Inactive</em>}</li>
* </ul>
*
* @generated
*/
public class GroupMemberImpl extends BackboneElementImpl implements GroupMember {
/**
* The cached value of the '{@link #getEntity() <em>Entity</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntity()
* @generated
* @ordered
*/
protected Resource entity;
/**
* 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 #getInactive() <em>Inactive</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInactive()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.Boolean inactive;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GroupMemberImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getGroupMember();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource getEntity() {
if (entity != null && entity.eIsProxy()) {
InternalEObject oldEntity = (InternalEObject)entity;
entity = (Resource)eResolveProxy(oldEntity);
if (entity != oldEntity) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.GROUP_MEMBER__ENTITY, oldEntity, entity));
}
}
return entity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Resource basicGetEntity() {
return entity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEntity(Resource newEntity) {
Resource oldEntity = entity;
entity = newEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.GROUP_MEMBER__ENTITY, oldEntity, entity));
}
/**
* <!-- 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, FhirResourcePackage.GROUP_MEMBER__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, FhirResourcePackage.GROUP_MEMBER__PERIOD, oldPeriod, period));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.Boolean getInactive() {
if (inactive != null && inactive.eIsProxy()) {
InternalEObject oldInactive = (InternalEObject)inactive;
inactive = (org.eclipse.mdht.uml.fhir.core.datatype.Boolean)eResolveProxy(oldInactive);
if (inactive != oldInactive) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.GROUP_MEMBER__INACTIVE, oldInactive, inactive));
}
}
return inactive;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.Boolean basicGetInactive() {
return inactive;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInactive(org.eclipse.mdht.uml.fhir.core.datatype.Boolean newInactive) {
org.eclipse.mdht.uml.fhir.core.datatype.Boolean oldInactive = inactive;
inactive = newInactive;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.GROUP_MEMBER__INACTIVE, oldInactive, inactive));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirResourcePackage.GROUP_MEMBER__ENTITY:
if (resolve) return getEntity();
return basicGetEntity();
case FhirResourcePackage.GROUP_MEMBER__PERIOD:
if (resolve) return getPeriod();
return basicGetPeriod();
case FhirResourcePackage.GROUP_MEMBER__INACTIVE:
if (resolve) return getInactive();
return basicGetInactive();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirResourcePackage.GROUP_MEMBER__ENTITY:
setEntity((Resource)newValue);
return;
case FhirResourcePackage.GROUP_MEMBER__PERIOD:
setPeriod((Period)newValue);
return;
case FhirResourcePackage.GROUP_MEMBER__INACTIVE:
setInactive((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.GROUP_MEMBER__ENTITY:
setEntity((Resource)null);
return;
case FhirResourcePackage.GROUP_MEMBER__PERIOD:
setPeriod((Period)null);
return;
case FhirResourcePackage.GROUP_MEMBER__INACTIVE:
setInactive((org.eclipse.mdht.uml.fhir.core.datatype.Boolean)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.GROUP_MEMBER__ENTITY:
return entity != null;
case FhirResourcePackage.GROUP_MEMBER__PERIOD:
return period != null;
case FhirResourcePackage.GROUP_MEMBER__INACTIVE:
return inactive != null;
}
return super.eIsSet(featureID);
}
} //GroupMemberImpl