blob: 8308a3f90d01be576fd92d496b81898a068e2267 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.Coding;
import org.hl7.fhir.ContractSigner;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.Reference;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Contract Signer</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.ContractSignerImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.ContractSignerImpl#getParty <em>Party</em>}</li>
* <li>{@link org.hl7.fhir.impl.ContractSignerImpl#getSignature <em>Signature</em>}</li>
* </ul>
*
* @generated
*/
public class ContractSignerImpl extends BackboneElementImpl implements ContractSigner {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Coding type;
/**
* The cached value of the '{@link #getParty() <em>Party</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParty()
* @generated
* @ordered
*/
protected Reference party;
/**
* The cached value of the '{@link #getSignature() <em>Signature</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSignature()
* @generated
* @ordered
*/
protected org.hl7.fhir.String signature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ContractSignerImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getContractSigner();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Coding getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(Coding newType, NotificationChain msgs) {
Coding oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Coding newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Reference getParty() {
return party;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetParty(Reference newParty, NotificationChain msgs) {
Reference oldParty = party;
party = newParty;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__PARTY, oldParty, newParty);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParty(Reference newParty) {
if (newParty != party) {
NotificationChain msgs = null;
if (party != null)
msgs = ((InternalEObject)party).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__PARTY, null, msgs);
if (newParty != null)
msgs = ((InternalEObject)newParty).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__PARTY, null, msgs);
msgs = basicSetParty(newParty, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__PARTY, newParty, newParty));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.hl7.fhir.String getSignature() {
return signature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSignature(org.hl7.fhir.String newSignature, NotificationChain msgs) {
org.hl7.fhir.String oldSignature = signature;
signature = newSignature;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__SIGNATURE, oldSignature, newSignature);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSignature(org.hl7.fhir.String newSignature) {
if (newSignature != signature) {
NotificationChain msgs = null;
if (signature != null)
msgs = ((InternalEObject)signature).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__SIGNATURE, null, msgs);
if (newSignature != null)
msgs = ((InternalEObject)newSignature).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTRACT_SIGNER__SIGNATURE, null, msgs);
msgs = basicSetSignature(newSignature, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTRACT_SIGNER__SIGNATURE, newSignature, newSignature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.CONTRACT_SIGNER__TYPE:
return basicSetType(null, msgs);
case FhirPackage.CONTRACT_SIGNER__PARTY:
return basicSetParty(null, msgs);
case FhirPackage.CONTRACT_SIGNER__SIGNATURE:
return basicSetSignature(null, 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.CONTRACT_SIGNER__TYPE:
return getType();
case FhirPackage.CONTRACT_SIGNER__PARTY:
return getParty();
case FhirPackage.CONTRACT_SIGNER__SIGNATURE:
return getSignature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FhirPackage.CONTRACT_SIGNER__TYPE:
setType((Coding)newValue);
return;
case FhirPackage.CONTRACT_SIGNER__PARTY:
setParty((Reference)newValue);
return;
case FhirPackage.CONTRACT_SIGNER__SIGNATURE:
setSignature((org.hl7.fhir.String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.CONTRACT_SIGNER__TYPE:
setType((Coding)null);
return;
case FhirPackage.CONTRACT_SIGNER__PARTY:
setParty((Reference)null);
return;
case FhirPackage.CONTRACT_SIGNER__SIGNATURE:
setSignature((org.hl7.fhir.String)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.CONTRACT_SIGNER__TYPE:
return type != null;
case FhirPackage.CONTRACT_SIGNER__PARTY:
return party != null;
case FhirPackage.CONTRACT_SIGNER__SIGNATURE:
return signature != null;
}
return super.eIsSet(featureID);
}
} //ContractSignerImpl