/** * Copyright (c) 2010-2016 by the respective copyright holders. * * 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 */ package org.openhab.binding.tinkerforge.internal.model.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.openhab.binding.tinkerforge.internal.model.ButtonConfiguration; import org.openhab.binding.tinkerforge.internal.model.ModelPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Button Configuration</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.ButtonConfigurationImpl#isTactile <em>Tactile</em>} * </li> * </ul> * * @generated */ public class ButtonConfigurationImpl extends MinimalEObjectImpl.Container implements ButtonConfiguration { /** * The default value of the '{@link #isTactile() <em>Tactile</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #isTactile() * @generated * @ordered */ protected static final boolean TACTILE_EDEFAULT = false; /** * The cached value of the '{@link #isTactile() <em>Tactile</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @see #isTactile() * @generated * @ordered */ protected boolean tactile = TACTILE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ protected ButtonConfigurationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return ModelPackage.Literals.BUTTON_CONFIGURATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public boolean isTactile() { return tactile; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void setTactile(boolean newTactile) { boolean oldTactile = tactile; tactile = newTactile; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.BUTTON_CONFIGURATION__TACTILE, oldTactile, tactile)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ModelPackage.BUTTON_CONFIGURATION__TACTILE: return isTactile(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ModelPackage.BUTTON_CONFIGURATION__TACTILE: setTactile((Boolean) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ModelPackage.BUTTON_CONFIGURATION__TACTILE: setTactile(TACTILE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ModelPackage.BUTTON_CONFIGURATION__TACTILE: return tactile != TACTILE_EDEFAULT; } 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(" (tactile: "); result.append(tactile); result.append(')'); return result.toString(); } } // ButtonConfigurationImpl