blob: b1caa820bc0b5b3550da40bc106820ef85fdbc48 [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.CodeableConcept;
import org.hl7.fhir.Decimal;
import org.hl7.fhir.FhirPackage;
import org.hl7.fhir.InvoicePriceComponent;
import org.hl7.fhir.InvoicePriceComponentType;
import org.hl7.fhir.Money;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Invoice Price Component</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.InvoicePriceComponentImpl#getType <em>Type</em>}</li>
* <li>{@link org.hl7.fhir.impl.InvoicePriceComponentImpl#getCode <em>Code</em>}</li>
* <li>{@link org.hl7.fhir.impl.InvoicePriceComponentImpl#getFactor <em>Factor</em>}</li>
* <li>{@link org.hl7.fhir.impl.InvoicePriceComponentImpl#getAmount <em>Amount</em>}</li>
* </ul>
*
* @generated
*/
public class InvoicePriceComponentImpl extends BackboneElementImpl implements InvoicePriceComponent {
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected InvoicePriceComponentType type;
/**
* 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 #getFactor() <em>Factor</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFactor()
* @generated
* @ordered
*/
protected Decimal factor;
/**
* The cached value of the '{@link #getAmount() <em>Amount</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAmount()
* @generated
* @ordered
*/
protected Money amount;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InvoicePriceComponentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getInvoicePriceComponent();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public InvoicePriceComponentType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(InvoicePriceComponentType newType, NotificationChain msgs) {
InvoicePriceComponentType oldType = type;
type = newType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(InvoicePriceComponentType newType) {
if (newType != type) {
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__TYPE, newType, newType));
}
/**
* <!-- 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.INVOICE_PRICE_COMPONENT__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.INVOICE_PRICE_COMPONENT__CODE, null, msgs);
if (newCode != null)
msgs = ((InternalEObject)newCode).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__CODE, null, msgs);
msgs = basicSetCode(newCode, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__CODE, newCode, newCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Decimal getFactor() {
return factor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFactor(Decimal newFactor, NotificationChain msgs) {
Decimal oldFactor = factor;
factor = newFactor;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR, oldFactor, newFactor);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFactor(Decimal newFactor) {
if (newFactor != factor) {
NotificationChain msgs = null;
if (factor != null)
msgs = ((InternalEObject)factor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR, null, msgs);
if (newFactor != null)
msgs = ((InternalEObject)newFactor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR, null, msgs);
msgs = basicSetFactor(newFactor, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR, newFactor, newFactor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Money getAmount() {
return amount;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAmount(Money newAmount, NotificationChain msgs) {
Money oldAmount = amount;
amount = newAmount;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT, oldAmount, newAmount);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAmount(Money newAmount) {
if (newAmount != amount) {
NotificationChain msgs = null;
if (amount != null)
msgs = ((InternalEObject)amount).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT, null, msgs);
if (newAmount != null)
msgs = ((InternalEObject)newAmount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT, null, msgs);
msgs = basicSetAmount(newAmount, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT, newAmount, newAmount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirPackage.INVOICE_PRICE_COMPONENT__TYPE:
return basicSetType(null, msgs);
case FhirPackage.INVOICE_PRICE_COMPONENT__CODE:
return basicSetCode(null, msgs);
case FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR:
return basicSetFactor(null, msgs);
case FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT:
return basicSetAmount(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.INVOICE_PRICE_COMPONENT__TYPE:
return getType();
case FhirPackage.INVOICE_PRICE_COMPONENT__CODE:
return getCode();
case FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR:
return getFactor();
case FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT:
return getAmount();
}
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.INVOICE_PRICE_COMPONENT__TYPE:
setType((InvoicePriceComponentType)newValue);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__CODE:
setCode((CodeableConcept)newValue);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR:
setFactor((Decimal)newValue);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT:
setAmount((Money)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.INVOICE_PRICE_COMPONENT__TYPE:
setType((InvoicePriceComponentType)null);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__CODE:
setCode((CodeableConcept)null);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR:
setFactor((Decimal)null);
return;
case FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT:
setAmount((Money)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.INVOICE_PRICE_COMPONENT__TYPE:
return type != null;
case FhirPackage.INVOICE_PRICE_COMPONENT__CODE:
return code != null;
case FhirPackage.INVOICE_PRICE_COMPONENT__FACTOR:
return factor != null;
case FhirPackage.INVOICE_PRICE_COMPONENT__AMOUNT:
return amount != null;
}
return super.eIsSet(featureID);
}
} //InvoicePriceComponentImpl