| /** |
| */ |
| 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.ContactPoint; |
| import org.hl7.fhir.ContactPointSystem; |
| import org.hl7.fhir.ContactPointUse; |
| import org.hl7.fhir.FhirPackage; |
| import org.hl7.fhir.Period; |
| import org.hl7.fhir.PositiveInt; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Contact Point</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.hl7.fhir.impl.ContactPointImpl#getSystem <em>System</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ContactPointImpl#getValue <em>Value</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ContactPointImpl#getUse <em>Use</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ContactPointImpl#getRank <em>Rank</em>}</li> |
| * <li>{@link org.hl7.fhir.impl.ContactPointImpl#getPeriod <em>Period</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ContactPointImpl extends ElementImpl implements ContactPoint { |
| /** |
| * The cached value of the '{@link #getSystem() <em>System</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSystem() |
| * @generated |
| * @ordered |
| */ |
| protected ContactPointSystem system; |
| |
| /** |
| * The cached value of the '{@link #getValue() <em>Value</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getValue() |
| * @generated |
| * @ordered |
| */ |
| protected org.hl7.fhir.String value; |
| |
| /** |
| * The cached value of the '{@link #getUse() <em>Use</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUse() |
| * @generated |
| * @ordered |
| */ |
| protected ContactPointUse use; |
| |
| /** |
| * The cached value of the '{@link #getRank() <em>Rank</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getRank() |
| * @generated |
| * @ordered |
| */ |
| protected PositiveInt rank; |
| |
| /** |
| * The cached value of the '{@link #getPeriod() <em>Period</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPeriod() |
| * @generated |
| * @ordered |
| */ |
| protected Period period; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ContactPointImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FhirPackage.eINSTANCE.getContactPoint(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ContactPointSystem getSystem() { |
| return system; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetSystem(ContactPointSystem newSystem, NotificationChain msgs) { |
| ContactPointSystem oldSystem = system; |
| system = newSystem; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__SYSTEM, oldSystem, newSystem); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSystem(ContactPointSystem newSystem) { |
| if (newSystem != system) { |
| NotificationChain msgs = null; |
| if (system != null) |
| msgs = ((InternalEObject)system).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__SYSTEM, null, msgs); |
| if (newSystem != null) |
| msgs = ((InternalEObject)newSystem).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__SYSTEM, null, msgs); |
| msgs = basicSetSystem(newSystem, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__SYSTEM, newSystem, newSystem)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public org.hl7.fhir.String getValue() { |
| return value; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetValue(org.hl7.fhir.String newValue, NotificationChain msgs) { |
| org.hl7.fhir.String oldValue = value; |
| value = newValue; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__VALUE, oldValue, newValue); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setValue(org.hl7.fhir.String newValue) { |
| if (newValue != value) { |
| NotificationChain msgs = null; |
| if (value != null) |
| msgs = ((InternalEObject)value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__VALUE, null, msgs); |
| if (newValue != null) |
| msgs = ((InternalEObject)newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__VALUE, null, msgs); |
| msgs = basicSetValue(newValue, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__VALUE, newValue, newValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ContactPointUse getUse() { |
| return use; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetUse(ContactPointUse newUse, NotificationChain msgs) { |
| ContactPointUse oldUse = use; |
| use = newUse; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__USE, oldUse, newUse); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUse(ContactPointUse newUse) { |
| if (newUse != use) { |
| NotificationChain msgs = null; |
| if (use != null) |
| msgs = ((InternalEObject)use).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__USE, null, msgs); |
| if (newUse != null) |
| msgs = ((InternalEObject)newUse).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__USE, null, msgs); |
| msgs = basicSetUse(newUse, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__USE, newUse, newUse)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PositiveInt getRank() { |
| return rank; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetRank(PositiveInt newRank, NotificationChain msgs) { |
| PositiveInt oldRank = rank; |
| rank = newRank; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__RANK, oldRank, newRank); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setRank(PositiveInt newRank) { |
| if (newRank != rank) { |
| NotificationChain msgs = null; |
| if (rank != null) |
| msgs = ((InternalEObject)rank).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__RANK, null, msgs); |
| if (newRank != null) |
| msgs = ((InternalEObject)newRank).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__RANK, null, msgs); |
| msgs = basicSetRank(newRank, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__RANK, newRank, newRank)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Period getPeriod() { |
| return period; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetPeriod(Period newPeriod, NotificationChain msgs) { |
| Period oldPeriod = period; |
| period = newPeriod; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__PERIOD, oldPeriod, newPeriod); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPeriod(Period newPeriod) { |
| if (newPeriod != period) { |
| NotificationChain msgs = null; |
| if (period != null) |
| msgs = ((InternalEObject)period).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__PERIOD, null, msgs); |
| if (newPeriod != null) |
| msgs = ((InternalEObject)newPeriod).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirPackage.CONTACT_POINT__PERIOD, null, msgs); |
| msgs = basicSetPeriod(newPeriod, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.CONTACT_POINT__PERIOD, newPeriod, newPeriod)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case FhirPackage.CONTACT_POINT__SYSTEM: |
| return basicSetSystem(null, msgs); |
| case FhirPackage.CONTACT_POINT__VALUE: |
| return basicSetValue(null, msgs); |
| case FhirPackage.CONTACT_POINT__USE: |
| return basicSetUse(null, msgs); |
| case FhirPackage.CONTACT_POINT__RANK: |
| return basicSetRank(null, msgs); |
| case FhirPackage.CONTACT_POINT__PERIOD: |
| return basicSetPeriod(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.CONTACT_POINT__SYSTEM: |
| return getSystem(); |
| case FhirPackage.CONTACT_POINT__VALUE: |
| return getValue(); |
| case FhirPackage.CONTACT_POINT__USE: |
| return getUse(); |
| case FhirPackage.CONTACT_POINT__RANK: |
| return getRank(); |
| case FhirPackage.CONTACT_POINT__PERIOD: |
| return getPeriod(); |
| } |
| 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.CONTACT_POINT__SYSTEM: |
| setSystem((ContactPointSystem)newValue); |
| return; |
| case FhirPackage.CONTACT_POINT__VALUE: |
| setValue((org.hl7.fhir.String)newValue); |
| return; |
| case FhirPackage.CONTACT_POINT__USE: |
| setUse((ContactPointUse)newValue); |
| return; |
| case FhirPackage.CONTACT_POINT__RANK: |
| setRank((PositiveInt)newValue); |
| return; |
| case FhirPackage.CONTACT_POINT__PERIOD: |
| setPeriod((Period)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CONTACT_POINT__SYSTEM: |
| setSystem((ContactPointSystem)null); |
| return; |
| case FhirPackage.CONTACT_POINT__VALUE: |
| setValue((org.hl7.fhir.String)null); |
| return; |
| case FhirPackage.CONTACT_POINT__USE: |
| setUse((ContactPointUse)null); |
| return; |
| case FhirPackage.CONTACT_POINT__RANK: |
| setRank((PositiveInt)null); |
| return; |
| case FhirPackage.CONTACT_POINT__PERIOD: |
| setPeriod((Period)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FhirPackage.CONTACT_POINT__SYSTEM: |
| return system != null; |
| case FhirPackage.CONTACT_POINT__VALUE: |
| return value != null; |
| case FhirPackage.CONTACT_POINT__USE: |
| return use != null; |
| case FhirPackage.CONTACT_POINT__RANK: |
| return rank != null; |
| case FhirPackage.CONTACT_POINT__PERIOD: |
| return period != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ContactPointImpl |