blob: 340d2a79ad7d634dd45aa0a0296cd9819e31a07f [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.CodeableConcept;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Group;
import org.hl7.fhir.GroupCharacteristic;
import org.hl7.fhir.GroupMember;
import org.hl7.fhir.GroupType;
import org.hl7.fhir.Identifier;
import org.hl7.fhir.UnsignedInt;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Group</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getActual <em>Actual</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getCode <em>Code</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getName <em>Name</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getQuantity <em>Quantity</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getCharacteristic <em>Characteristic</em>}</li>
* <li>{@link org.hl7.fhir.impl.GroupImpl#getMember <em>Member</em>}</li>
* </ul>
*
* @generated
*/
public class GroupImpl extends DomainResourceImpl implements Group {
/**
* The cached value of the '{@link #getIdentifier() <em>Identifier</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdentifier()
* @generated
* @ordered
*/
protected EList<Identifier> identifier;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected GroupType type;
/**
* The cached value of the '{@link #getActual() <em>Actual</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActual()
* @generated
* @ordered
*/
protected org.hl7.fhir.Boolean actual;
/**
* The cached value of the '{@link #getCode() <em>Code</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCode()
* @generated
* @ordered
*/
protected CodeableConcept code;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected org.hl7.fhir.String name;
/**
* The cached value of the '{@link #getQuantity() <em>Quantity</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQuantity()
* @generated
* @ordered
*/
protected UnsignedInt quantity;
/**
* The cached value of the '{@link #getCharacteristic() <em>Characteristic</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCharacteristic()
* @generated
* @ordered
*/
protected EList<GroupCharacteristic> characteristic;
/**
* The cached value of the '{@link #getMember() <em>Member</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMember()
* @generated
* @ordered
*/
protected EList<GroupMember> member;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GroupImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getGroup();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Identifier> getIdentifier() {
if (identifier == null) {
identifier = new EObjectContainmentEList<Identifier>(Identifier.class, this, FhirPackage.GROUP__IDENTIFIER);
}
return identifier;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GroupType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(GroupType newType, NotificationChain msgs) {
GroupType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(GroupType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.Boolean getActual() {
return actual;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetActual(org.hl7.fhir.Boolean newActual, NotificationChain msgs) {
org.hl7.fhir.Boolean oldActual = actual;
actual = newActual;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__ACTUAL, oldActual, newActual);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setActual(org.hl7.fhir.Boolean newActual) {
if (newActual != actual) {
NotificationChain msgs = null;
if (actual != null)
msgs = ((InternalEObject)actual).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__ACTUAL, null, msgs);
if (newActual != null)
msgs = ((InternalEObject)newActual).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__ACTUAL, null, msgs);
msgs = basicSetActual(newActual, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__ACTUAL, newActual, newActual));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CodeableConcept getCode() {
return code;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetCode(CodeableConcept newCode, NotificationChain msgs) {
CodeableConcept oldCode = code;
code = newCode;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__CODE, oldCode, newCode);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCode(CodeableConcept newCode) {
if (newCode != code) {
NotificationChain msgs = null;
if (code != null)
msgs = ((InternalEObject)code).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__CODE, null, msgs);
if (newCode != null)
msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__CODE, null, msgs);
msgs = basicSetCode(newCode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__CODE, newCode, newCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetName(org.hl7.fhir.String newName, NotificationChain msgs) {
org.hl7.fhir.String oldName = name;
name = newName;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__NAME, oldName, newName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(org.hl7.fhir.String newName) {
if (newName != name) {
NotificationChain msgs = null;
if (name != null)
msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__NAME, null, msgs);
if (newName != null)
msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__NAME, null, msgs);
msgs = basicSetName(newName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__NAME, newName, newName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public UnsignedInt getQuantity() {
return quantity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetQuantity(UnsignedInt newQuantity, NotificationChain msgs) {
UnsignedInt oldQuantity = quantity;
quantity = newQuantity;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__QUANTITY, oldQuantity, newQuantity);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setQuantity(UnsignedInt newQuantity) {
if (newQuantity != quantity) {
NotificationChain msgs = null;
if (quantity != null)
msgs = ((InternalEObject)quantity).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__QUANTITY, null, msgs);
if (newQuantity != null)
msgs = ((InternalEObject)newQuantity).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.GROUP__QUANTITY, null, msgs);
msgs = basicSetQuantity(newQuantity, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.GROUP__QUANTITY, newQuantity, newQuantity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<GroupCharacteristic> getCharacteristic() {
if (characteristic == null) {
characteristic = new EObjectContainmentEList<GroupCharacteristic>(GroupCharacteristic.class, this, FhirPackage.GROUP__CHARACTERISTIC);
}
return characteristic;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<GroupMember> getMember() {
if (member == null) {
member = new EObjectContainmentEList<GroupMember>(GroupMember.class, this, FhirPackage.GROUP__MEMBER);
}
return member;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.GROUP__IDENTIFIER:
return ((InternalEList<?>)getIdentifier()).basicRemove(otherEnd, msgs);
case FhirPackage.GROUP__TYPE:
return basicSetType(null, msgs);
case FhirPackage.GROUP__ACTUAL:
return basicSetActual(null, msgs);
case FhirPackage.GROUP__CODE:
return basicSetCode(null, msgs);
case FhirPackage.GROUP__NAME:
return basicSetName(null, msgs);
case FhirPackage.GROUP__QUANTITY:
return basicSetQuantity(null, msgs);
case FhirPackage.GROUP__CHARACTERISTIC:
return ((InternalEList<?>)getCharacteristic()).basicRemove(otherEnd, msgs);
case FhirPackage.GROUP__MEMBER:
return ((InternalEList<?>)getMember()).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.GROUP__IDENTIFIER:
return getIdentifier();
case FhirPackage.GROUP__TYPE:
return getType();
case FhirPackage.GROUP__ACTUAL:
return getActual();
case FhirPackage.GROUP__CODE:
return getCode();
case FhirPackage.GROUP__NAME:
return getName();
case FhirPackage.GROUP__QUANTITY:
return getQuantity();
case FhirPackage.GROUP__CHARACTERISTIC:
return getCharacteristic();
case FhirPackage.GROUP__MEMBER:
return getMember();
}
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.GROUP__IDENTIFIER:
getIdentifier().clear();
getIdentifier().addAll((Collection<? extends Identifier>)newValue);
return;
case FhirPackage.GROUP__TYPE:
setType((GroupType)newValue);
return;
case FhirPackage.GROUP__ACTUAL:
setActual((org.hl7.fhir.Boolean)newValue);
return;
case FhirPackage.GROUP__CODE:
setCode((CodeableConcept)newValue);
return;
case FhirPackage.GROUP__NAME:
setName((org.hl7.fhir.String)newValue);
return;
case FhirPackage.GROUP__QUANTITY:
setQuantity((UnsignedInt)newValue);
return;
case FhirPackage.GROUP__CHARACTERISTIC:
getCharacteristic().clear();
getCharacteristic().addAll((Collection<? extends GroupCharacteristic>)newValue);
return;
case FhirPackage.GROUP__MEMBER:
getMember().clear();
getMember().addAll((Collection<? extends GroupMember>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.GROUP__IDENTIFIER:
getIdentifier().clear();
return;
case FhirPackage.GROUP__TYPE:
setType((GroupType)null);
return;
case FhirPackage.GROUP__ACTUAL:
setActual((org.hl7.fhir.Boolean)null);
return;
case FhirPackage.GROUP__CODE:
setCode((CodeableConcept)null);
return;
case FhirPackage.GROUP__NAME:
setName((org.hl7.fhir.String)null);
return;
case FhirPackage.GROUP__QUANTITY:
setQuantity((UnsignedInt)null);
return;
case FhirPackage.GROUP__CHARACTERISTIC:
getCharacteristic().clear();
return;
case FhirPackage.GROUP__MEMBER:
getMember().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.GROUP__IDENTIFIER:
return identifier != null && !identifier.isEmpty();
case FhirPackage.GROUP__TYPE:
return type != null;
case FhirPackage.GROUP__ACTUAL:
return actual != null;
case FhirPackage.GROUP__CODE:
return code != null;
case FhirPackage.GROUP__NAME:
return name != null;
case FhirPackage.GROUP__QUANTITY:
return quantity != null;
case FhirPackage.GROUP__CHARACTERISTIC:
return characteristic != null && !characteristic.isEmpty();
case FhirPackage.GROUP__MEMBER:
return member != null && !member.isEmpty();
}
return super.eIsSet(featureID);
}
} //GroupImpl