blob: efe662682c21073382b43e17d1f8dac9970c5e51 [file] [log] [blame]
/**
*/
package org.hl7.fhir.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.hl7.fhir.DocumentReferenceStatus;
import org.hl7.fhir.DocumentReferenceStatusList;
import org.hl7.fhir.FhirPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Document Reference Status</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.hl7.fhir.impl.DocumentReferenceStatusImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class DocumentReferenceStatusImpl extends ElementImpl implements DocumentReferenceStatus {
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final DocumentReferenceStatusList VALUE_EDEFAULT = DocumentReferenceStatusList.CURRENT;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected DocumentReferenceStatusList value = VALUE_EDEFAULT;
/**
* This is true if the Value attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean valueESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DocumentReferenceStatusImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FhirPackage.eINSTANCE.getDocumentReferenceStatus();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public DocumentReferenceStatusList getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(DocumentReferenceStatusList newValue) {
DocumentReferenceStatusList oldValue = value;
value = newValue == null ? VALUE_EDEFAULT : newValue;
boolean oldValueESet = valueESet;
valueESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FhirPackage.DOCUMENT_REFERENCE_STATUS__VALUE, oldValue, value, !oldValueESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetValue() {
DocumentReferenceStatusList oldValue = value;
boolean oldValueESet = valueESet;
value = VALUE_EDEFAULT;
valueESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, FhirPackage.DOCUMENT_REFERENCE_STATUS__VALUE, oldValue, VALUE_EDEFAULT, oldValueESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetValue() {
return valueESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FhirPackage.DOCUMENT_REFERENCE_STATUS__VALUE:
return getValue();
}
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.DOCUMENT_REFERENCE_STATUS__VALUE:
setValue((DocumentReferenceStatusList)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FhirPackage.DOCUMENT_REFERENCE_STATUS__VALUE:
unsetValue();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FhirPackage.DOCUMENT_REFERENCE_STATUS__VALUE:
return isSetValue();
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (value: ");
if (valueESet) result.append(value); else result.append("<unset>");
result.append(')');
return result.toString();
}
} //DocumentReferenceStatusImpl