/**
 */
package demo.catalog.democatalog.impl;

import demo.catalog.democatalog.Boiler;
import demo.catalog.democatalog.BoilerType;
import demo.catalog.democatalog.DemoCatalogPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Boiler</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link demo.catalog.democatalog.impl.BoilerImpl#getBoilerType <em>Boiler Type</em>}</li>
 * </ul>
 *
 * @generated
 */
public class BoilerImpl extends ChemicalEnergyDeviceImpl implements Boiler {
	/**
	 * The default value of the '{@link #getBoilerType() <em>Boiler Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBoilerType()
	 * @generated
	 * @ordered
	 */
	protected static final BoilerType BOILER_TYPE_EDEFAULT = BoilerType.LOW_TEMPERATURE;

	/**
	 * The cached value of the '{@link #getBoilerType() <em>Boiler Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getBoilerType()
	 * @generated
	 * @ordered
	 */
	protected BoilerType boilerType = BOILER_TYPE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BoilerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DemoCatalogPackage.Literals.BOILER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BoilerType getBoilerType() {
		return boilerType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBoilerType(BoilerType newBoilerType) {
		BoilerType oldBoilerType = boilerType;
		boilerType = newBoilerType == null ? BOILER_TYPE_EDEFAULT : newBoilerType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, DemoCatalogPackage.BOILER__BOILER_TYPE, oldBoilerType,
					boilerType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DemoCatalogPackage.BOILER__BOILER_TYPE:
			return getBoilerType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DemoCatalogPackage.BOILER__BOILER_TYPE:
			setBoilerType((BoilerType) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DemoCatalogPackage.BOILER__BOILER_TYPE:
			setBoilerType(BOILER_TYPE_EDEFAULT);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DemoCatalogPackage.BOILER__BOILER_TYPE:
			return boilerType != BOILER_TYPE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy())
			return super.toString();

		StringBuilder result = new StringBuilder(super.toString());
		result.append(" (boilerType: ");
		result.append(boilerType);
		result.append(')');
		return result.toString();
	}

} //BoilerImpl
