blob: 29e0c5d0e9e3238da4985da51eb97d1b35142ba6 [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 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.eclipse.mdht.uml.fhir.core.datatype.Code;
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.OperationDefinitionParameter;
import org.eclipse.mdht.uml.fhir.core.resource.OperationDefinitionParameterBinding;
import org.eclipse.mdht.uml.fhir.core.resource.StructureDefinition;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Operation Definition Parameter</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getUse <em>Use</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getMin <em>Min</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getMax <em>Max</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getDocumentation <em>Documentation</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getProfile <em>Profile</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getBinding <em>Binding</em>}</li>
* <li>{@link org.eclipse.mdht.uml.fhir.core.resource.impl.OperationDefinitionParameterImpl#getParts <em>Part</em>}</li>
* </ul>
*
* @generated
*/
public class OperationDefinitionParameterImpl extends BackboneElementImpl implements OperationDefinitionParameter {
/**
* The cached value of the '{@link #getName() <em>Name</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected Code name;
/**
* The cached value of the '{@link #getUse() <em>Use</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getUse()
* @generated
* @ordered
*/
protected Code use;
/**
* The cached value of the '{@link #getMin() <em>Min</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMin()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.Integer min;
/**
* The cached value of the '{@link #getMax() <em>Max</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMax()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String max;
/**
* The cached value of the '{@link #getDocumentation() <em>Documentation</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDocumentation()
* @generated
* @ordered
*/
protected org.eclipse.mdht.uml.fhir.core.datatype.String documentation;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Code type;
/**
* The cached value of the '{@link #getProfile() <em>Profile</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProfile()
* @generated
* @ordered
*/
protected StructureDefinition profile;
/**
* The cached value of the '{@link #getBinding() <em>Binding</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBinding()
* @generated
* @ordered
*/
protected OperationDefinitionParameterBinding binding;
/**
* The cached value of the '{@link #getParts() <em>Part</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParts()
* @generated
* @ordered
*/
protected EList<OperationDefinitionParameter> parts;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected OperationDefinitionParameterImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirResourcePackage.eINSTANCE.getOperationDefinitionParameter();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getName() {
if (name != null && name.eIsProxy()) {
InternalEObject oldName = (InternalEObject)name;
name = (Code)eResolveProxy(oldName);
if (name != oldName) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME, oldName, name));
}
}
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(Code newName) {
Code oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getUse() {
if (use != null && use.eIsProxy()) {
InternalEObject oldUse = (InternalEObject)use;
use = (Code)eResolveProxy(oldUse);
if (use != oldUse) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE, oldUse, use));
}
}
return use;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetUse() {
return use;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setUse(Code newUse) {
Code oldUse = use;
use = newUse;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE, oldUse, use));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.Integer getMin() {
if (min != null && min.eIsProxy()) {
InternalEObject oldMin = (InternalEObject)min;
min = (org.eclipse.mdht.uml.fhir.core.datatype.Integer)eResolveProxy(oldMin);
if (min != oldMin) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN, oldMin, min));
}
}
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.Integer basicGetMin() {
return min;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMin(org.eclipse.mdht.uml.fhir.core.datatype.Integer newMin) {
org.eclipse.mdht.uml.fhir.core.datatype.Integer oldMin = min;
min = newMin;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN, oldMin, min));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getMax() {
if (max != null && max.eIsProxy()) {
InternalEObject oldMax = (InternalEObject)max;
max = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldMax);
if (max != oldMax) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX, oldMax, max));
}
}
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetMax() {
return max;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMax(org.eclipse.mdht.uml.fhir.core.datatype.String newMax) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldMax = max;
max = newMax;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX, oldMax, max));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String getDocumentation() {
if (documentation != null && documentation.eIsProxy()) {
InternalEObject oldDocumentation = (InternalEObject)documentation;
documentation = (org.eclipse.mdht.uml.fhir.core.datatype.String)eResolveProxy(oldDocumentation);
if (documentation != oldDocumentation) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION, oldDocumentation, documentation));
}
}
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.mdht.uml.fhir.core.datatype.String basicGetDocumentation() {
return documentation;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDocumentation(org.eclipse.mdht.uml.fhir.core.datatype.String newDocumentation) {
org.eclipse.mdht.uml.fhir.core.datatype.String oldDocumentation = documentation;
documentation = newDocumentation;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION, oldDocumentation, documentation));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code getType() {
if (type != null && type.eIsProxy()) {
InternalEObject oldType = (InternalEObject)type;
type = (Code)eResolveProxy(oldType);
if (type != oldType) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE, oldType, type));
}
}
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Code basicGetType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Code newType) {
Code oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructureDefinition getProfile() {
if (profile != null && profile.eIsProxy()) {
InternalEObject oldProfile = (InternalEObject)profile;
profile = (StructureDefinition)eResolveProxy(oldProfile);
if (profile != oldProfile) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE, oldProfile, profile));
}
}
return profile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public StructureDefinition basicGetProfile() {
return profile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProfile(StructureDefinition newProfile) {
StructureDefinition oldProfile = profile;
profile = newProfile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE, oldProfile, profile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public OperationDefinitionParameterBinding getBinding() {
return binding;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetBinding(OperationDefinitionParameterBinding newBinding, NotificationChain msgs) {
OperationDefinitionParameterBinding oldBinding = binding;
binding = newBinding;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING, oldBinding, newBinding);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBinding(OperationDefinitionParameterBinding newBinding) {
if (newBinding != binding) {
NotificationChain msgs = null;
if (binding != null)
msgs = ((InternalEObject)binding).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING, null, msgs);
if (newBinding != null)
msgs = ((InternalEObject)newBinding).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING, null, msgs);
msgs = basicSetBinding(newBinding, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING, newBinding, newBinding));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<OperationDefinitionParameter> getParts() {
if (parts == null) {
parts = new EObjectContainmentEList<OperationDefinitionParameter>(OperationDefinitionParameter.class, this, FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART);
}
return parts;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING:
return basicSetBinding(null, msgs);
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART:
return ((InternalEList<?>)getParts()).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 FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME:
if (resolve) return getName();
return basicGetName();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE:
if (resolve) return getUse();
return basicGetUse();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN:
if (resolve) return getMin();
return basicGetMin();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX:
if (resolve) return getMax();
return basicGetMax();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION:
if (resolve) return getDocumentation();
return basicGetDocumentation();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE:
if (resolve) return getType();
return basicGetType();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE:
if (resolve) return getProfile();
return basicGetProfile();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING:
return getBinding();
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART:
return getParts();
}
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 FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME:
setName((Code)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE:
setUse((Code)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN:
setMin((org.eclipse.mdht.uml.fhir.core.datatype.Integer)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX:
setMax((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION:
setDocumentation((org.eclipse.mdht.uml.fhir.core.datatype.String)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE:
setType((Code)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE:
setProfile((StructureDefinition)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING:
setBinding((OperationDefinitionParameterBinding)newValue);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART:
getParts().clear();
getParts().addAll((Collection<? extends OperationDefinitionParameter>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME:
setName((Code)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE:
setUse((Code)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN:
setMin((org.eclipse.mdht.uml.fhir.core.datatype.Integer)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX:
setMax((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION:
setDocumentation((org.eclipse.mdht.uml.fhir.core.datatype.String)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE:
setType((Code)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE:
setProfile((StructureDefinition)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING:
setBinding((OperationDefinitionParameterBinding)null);
return;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART:
getParts().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__NAME:
return name != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__USE:
return use != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MIN:
return min != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__MAX:
return max != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__DOCUMENTATION:
return documentation != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__TYPE:
return type != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PROFILE:
return profile != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__BINDING:
return binding != null;
case FhirResourcePackage.OPERATION_DEFINITION_PARAMETER__PART:
return parts != null && !parts.isEmpty();
}
return super.eIsSet(featureID);
}
} //OperationDefinitionParameterImpl