gt:                 return poll != POLL_EDEFAULT;
context: /**
   * Copyright (c) 2010-2019 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 java.lang.reflect.InvocationTargetException;
  import java.util.concurrent.atomic.AtomicBoolean;
  
  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.impl.MinimalEObjectImpl;
  import org.eclipse.emf.ecore.util.EcoreUtil;
  import org.openhab.binding.tinkerforge.internal.LoggerConstants;
  import org.openhab.binding.tinkerforge.internal.TinkerforgeErrorHandler;
  import org.openhab.binding.tinkerforge.internal.model.CallbackListener;
  import org.openhab.binding.tinkerforge.internal.model.MBrickletRotaryEncoder;
  import org.openhab.binding.tinkerforge.internal.model.MSensor;
  import org.openhab.binding.tinkerforge.internal.model.MSubDeviceHolder;
  import org.openhab.binding.tinkerforge.internal.model.MTFConfigConsumer;
  import org.openhab.binding.tinkerforge.internal.model.ModelPackage;
  import org.openhab.binding.tinkerforge.internal.model.RotaryEncoder;
  import org.openhab.binding.tinkerforge.internal.model.TFBaseConfiguration;
  import org.openhab.binding.tinkerforge.internal.tools.Tools;
  import org.openhab.binding.tinkerforge.internal.types.DecimalValue;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import com.tinkerforge.BrickletRotaryEncoder;
  import com.tinkerforge.NotConnectedException;
  import com.tinkerforge.TimeoutException;
  
  /**
   * <!-- begin-user-doc -->
   * An implementation of the model object '<em><b>Rotary Encoder</b></em>'.
   * <!-- end-user-doc -->
   * <p>
   * The following features are implemented:
   * </p>
   * <ul>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getLogger <em>Logger</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getUid <em>Uid</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#isPoll <em>Poll</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getEnabledA <em>Enabled A</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getSubId <em>Sub Id</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getMbrick <em>Mbrick</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getSensorValue <em>Sensor
   * Value</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getCallbackPeriod <em>Callback
   * Period</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getTfConfig <em>Tf Config</em>}</li>
   * <li>{@link org.openhab.binding.tinkerforge.internal.model.impl.RotaryEncoderImpl#getDeviceType <em>Device Type</em>}
   * </li>
   * </ul>
   *
   * @generated
   */
  public class RotaryEncoderImpl extends MinimalEObjectImpl.Container implements RotaryEncoder {
      /**
       * The default value of the '{@link #getLogger() <em>Logger</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getLogger()
       * @generated
       * @ordered
       */
      protected static final Logger LOGGER_EDEFAULT = null;
  
      /**
       * The cached value of the '{@link #getLogger() <em>Logger</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getLogger()
       * @generated
       * @ordered
       */
      protected Logger logger = LOGGER_EDEFAULT;
  
      /**
       * The default value of the '{@link #getUid() <em>Uid</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getUid()
       * @generated
       * @ordered
       */
      protected static final String UID_EDEFAULT = null;
  
      /**
       * The cached value of the '{@link #getUid() <em>Uid</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getUid()
       * @generated
       * @ordered
       */
      protected String uid = UID_EDEFAULT;
  
      /**
       * The default value of the '{@link #isPoll() <em>Poll</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #isPoll()
       * @generated
       * @ordered
       */
      protected static final boolean POLL_EDEFAULT = true;
  
      /**
       * The cached value of the '{@link #isPoll() <em>Poll</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #isPoll()
       * @generated
       * @ordered
       */
      protected boolean poll = POLL_EDEFAULT;
  
      /**
       * The default value of the '{@link #getEnabledA() <em>Enabled A</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getEnabledA()
       * @generated
       * @ordered
       */
      protected static final AtomicBoolean ENABLED_A_EDEFAULT = null;
  
      /**
       * The cached value of the '{@link #getEnabledA() <em>Enabled A</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getEnabledA()
       * @generated
       * @ordered
       */
      protected AtomicBoolean enabledA = ENABLED_A_EDEFAULT;
  
      /**
       * The default value of the '{@link #getSubId() <em>Sub Id</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getSubId()
       * @generated
       * @ordered
       */
      protected static final String SUB_ID_EDEFAULT = null;
  
      /**
       * The cached value of the '{@link #getSubId() <em>Sub Id</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getSubId()
       * @generated
       * @ordered
       */
      protected String subId = SUB_ID_EDEFAULT;
  
      /**
       * The cached value of the '{@link #getSensorValue() <em>Sensor Value</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getSensorValue()
       * @generated
       * @ordered
       */
      protected DecimalValue sensorValue;
  
      /**
       * The default value of the '{@link #getCallbackPeriod() <em>Callback Period</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getCallbackPeriod()
       * @generated
       * @ordered
       */
      protected static final long CALLBACK_PERIOD_EDEFAULT = 1000L;
  
      /**
       * The cached value of the '{@link #getCallbackPeriod() <em>Callback Period</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getCallbackPeriod()
       * @generated
       * @ordered
       */
      protected long callbackPeriod = CALLBACK_PERIOD_EDEFAULT;
  
      /**
       * The cached value of the '{@link #getTfConfig() <em>Tf Config</em>}' containment reference.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getTfConfig()
       * @generated
       * @ordered
       */
      protected TFBaseConfiguration tfConfig;
  
      /**
       * The default value of the '{@link #getDeviceType() <em>Device Type</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getDeviceType()
       * @generated
       * @ordered
       */
      protected static final String DEVICE_TYPE_EDEFAULT = "rotary_encoder";
  
      /**
       * The cached value of the '{@link #getDeviceType() <em>Device Type</em>}' attribute.
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @see #getDeviceType()
       * @generated
       * @ordered
       */
      protected String deviceType = DEVICE_TYPE_EDEFAULT;
  
      private BrickletRotaryEncoder tinkerforgeDevice;
  
      private CountListener listener;
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      protected RotaryEncoderImpl() {
          super();
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      protected EClass eStaticClass() {
          return ModelPackage.Literals.ROTARY_ENCODER;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public Logger getLogger() {
          return logger;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setLogger(Logger newLogger) {
          Logger oldLogger = logger;
          logger = newLogger;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__LOGGER, oldLogger,
                      logger));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public String getUid() {
          return uid;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setUid(String newUid) {
          String oldUid = uid;
          uid = newUid;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__UID, oldUid, uid));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public boolean isPoll() {
          return poll;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setPoll(boolean newPoll) {
          boolean oldPoll = poll;
          poll = newPoll;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__POLL, oldPoll, poll));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public AtomicBoolean getEnabledA() {
          return enabledA;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setEnabledA(AtomicBoolean newEnabledA) {
          AtomicBoolean oldEnabledA = enabledA;
          enabledA = newEnabledA;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__ENABLED_A, oldEnabledA,
                      enabledA));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public String getSubId() {
          return subId;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setSubId(String newSubId) {
          String oldSubId = subId;
          subId = newSubId;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__SUB_ID, oldSubId,
                      subId));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public MBrickletRotaryEncoder getMbrick() {
          if (eContainerFeatureID() != ModelPackage.ROTARY_ENCODER__MBRICK)
              return null;
          return (MBrickletRotaryEncoder) eContainer();
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      public MBrickletRotaryEncoder basicGetMbrick() {
          if (eContainerFeatureID() != ModelPackage.ROTARY_ENCODER__MBRICK)
              return null;
          return (MBrickletRotaryEncoder) eInternalContainer();
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      public NotificationChain basicSetMbrick(MBrickletRotaryEncoder newMbrick, NotificationChain msgs) {
          msgs = eBasicSetContainer((InternalEObject) newMbrick, ModelPackage.ROTARY_ENCODER__MBRICK, msgs);
          return msgs;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setMbrick(MBrickletRotaryEncoder newMbrick) {
          if (newMbrick != eInternalContainer()
                  || (eContainerFeatureID() != ModelPackage.ROTARY_ENCODER__MBRICK && newMbrick != null)) {
              if (EcoreUtil.isAncestor(this, newMbrick))
                  throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
              NotificationChain msgs = null;
              if (eInternalContainer() != null)
                  msgs = eBasicRemoveFromContainer(msgs);
              if (newMbrick != null)
                  msgs = ((InternalEObject) newMbrick).eInverseAdd(this, ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES,
                          MSubDeviceHolder.class, msgs);
              msgs = basicSetMbrick(newMbrick, msgs);
              if (msgs != null)
                  msgs.dispatch();
          } else if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__MBRICK, newMbrick,
                      newMbrick));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public DecimalValue getSensorValue() {
          return sensorValue;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setSensorValue(DecimalValue newSensorValue) {
          DecimalValue oldSensorValue = sensorValue;
          sensorValue = newSensorValue;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__SENSOR_VALUE,
                      oldSensorValue, sensorValue));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public long getCallbackPeriod() {
          return callbackPeriod;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setCallbackPeriod(long newCallbackPeriod) {
          long oldCallbackPeriod = callbackPeriod;
          callbackPeriod = newCallbackPeriod;
          if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__CALLBACK_PERIOD,
                      oldCallbackPeriod, callbackPeriod));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public TFBaseConfiguration getTfConfig() {
          return tfConfig;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      public NotificationChain basicSetTfConfig(TFBaseConfiguration newTfConfig, NotificationChain msgs) {
          TFBaseConfiguration oldTfConfig = tfConfig;
          tfConfig = newTfConfig;
          if (eNotificationRequired()) {
              ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
                      ModelPackage.ROTARY_ENCODER__TF_CONFIG, oldTfConfig, newTfConfig);
              if (msgs == null)
                  msgs = notification;
              else
                  msgs.add(notification);
          }
          return msgs;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void setTfConfig(TFBaseConfiguration newTfConfig) {
          if (newTfConfig != tfConfig) {
              NotificationChain msgs = null;
              if (tfConfig != null)
                  msgs = ((InternalEObject) tfConfig).eInverseRemove(this,
                          EOPPOSITE_FEATURE_BASE - ModelPackage.ROTARY_ENCODER__TF_CONFIG, null, msgs);
              if (newTfConfig != null)
                  msgs = ((InternalEObject) newTfConfig).eInverseAdd(this,
                          EOPPOSITE_FEATURE_BASE - ModelPackage.ROTARY_ENCODER__TF_CONFIG, null, msgs);
              msgs = basicSetTfConfig(newTfConfig, msgs);
              if (msgs != null)
                  msgs.dispatch();
          } else if (eNotificationRequired())
              eNotify(new ENotificationImpl(this, Notification.SET, ModelPackage.ROTARY_ENCODER__TF_CONFIG, newTfConfig,
                      newTfConfig));
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public String getDeviceType() {
          return deviceType;
      }
  
      /**
       * <!-- begin-user-doc --> clear could be used from the tinkerforge action <!-- end-user-doc -->
       * 
       * @generated NOT
       */
      @Override
      public void clear() {
          try {
              logger.debug("clearing counter");
              tinkerforgeDevice.getCount(true);
          } catch (TimeoutException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
          } catch (NotConnectedException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
          }
      }
  
      /**
       * <!-- begin-user-doc --> <!-- end-user-doc -->
       * 
       * @generated NOT
       */
      @Override
      public void fetchSensorValue() {
          try {
              int count = tinkerforgeDevice.getCount(false);
              DecimalValue value = Tools.calculate(count);
              setSensorValue(value);
          } catch (TimeoutException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
          } catch (NotConnectedException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
          }
      }
  
      /**
       * <!-- begin-user-doc --> <!-- end-user-doc -->
       * 
       * @generated NOT
       */
      @Override
      public void init() {
          setEnabledA(new AtomicBoolean());
          logger = LoggerFactory.getLogger(RotaryEncoderImpl.class);
      }
  
      /**
       * <!-- begin-user-doc --> <!-- end-user-doc -->
       * 
       * @generated NOT
       */
      @Override
      public void enable() {
          setCallbackPeriod(10);
          if (tfConfig != null) {
              logger.trace("got configuration");
              if (tfConfig.eIsSet(tfConfig.eClass().getEStructuralFeature("callbackPeriod"))) {
                  logger.trace("found callbackPeriod");
                  setCallbackPeriod(tfConfig.getCallbackPeriod());
              }
          }
          logger.trace("callbackPeriod is {}", getCallbackPeriod());
          tinkerforgeDevice = getMbrick().getTinkerforgeDevice();
          tinkerforgeDevice.setResponseExpected(BrickletRotaryEncoder.FUNCTION_SET_COUNT_CALLBACK_PERIOD, false);
          try {
              tinkerforgeDevice.setCountCallbackPeriod(getCallbackPeriod());
              listener = new CountListener();
              tinkerforgeDevice.addCountListener(listener);
              fetchSensorValue();
          } catch (TimeoutException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);
          } catch (NotConnectedException e) {
              TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
          }
      }
  
      private class CountListener implements BrickletRotaryEncoder.CountListener {
  
          @Override
          public void count(int count) {
              DecimalValue value = Tools.calculate(count);
              logger.trace("{} got new value {}", LoggerConstants.TFMODELUPDATE, value);
              logger.trace("{} setting new value {}", LoggerConstants.TFMODELUPDATE, value);
              setSensorValue(value);
          }
  
      }
  
      /**
       * <!-- begin-user-doc --> <!-- end-user-doc -->
       * 
       * @generated NOT
       */
      @Override
      public void disable() {
          if (listener != null) {
              tinkerforgeDevice.removeCountListener(listener);
          }
          tinkerforgeDevice = null;
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
          switch (featureID) {
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  if (eInternalContainer() != null)
                      msgs = eBasicRemoveFromContainer(msgs);
                  return basicSetMbrick((MBrickletRotaryEncoder) otherEnd, msgs);
          }
          return super.eInverseAdd(otherEnd, featureID, msgs);
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
          switch (featureID) {
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  return basicSetMbrick(null, msgs);
              case ModelPackage.ROTARY_ENCODER__TF_CONFIG:
                  return basicSetTfConfig(null, msgs);
          }
          return super.eInverseRemove(otherEnd, featureID, msgs);
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
          switch (eContainerFeatureID()) {
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  return eInternalContainer().eInverseRemove(this, ModelPackage.MSUB_DEVICE_HOLDER__MSUBDEVICES,
                          MSubDeviceHolder.class, msgs);
          }
          return super.eBasicRemoveFromContainerFeature(msgs);
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public Object eGet(int featureID, boolean resolve, boolean coreType) {
          switch (featureID) {
              case ModelPackage.ROTARY_ENCODER__LOGGER:
                  return getLogger();
              case ModelPackage.ROTARY_ENCODER__UID:
                  return getUid();
              case ModelPackage.ROTARY_ENCODER__POLL:
                  return isPoll();
              case ModelPackage.ROTARY_ENCODER__ENABLED_A:
                  return getEnabledA();
              case ModelPackage.ROTARY_ENCODER__SUB_ID:
                  return getSubId();
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  if (resolve)
                      return getMbrick();
                  return basicGetMbrick();
              case ModelPackage.ROTARY_ENCODER__SENSOR_VALUE:
                  return getSensorValue();
              case ModelPackage.ROTARY_ENCODER__CALLBACK_PERIOD:
                  return getCallbackPeriod();
              case ModelPackage.ROTARY_ENCODER__TF_CONFIG:
                  return getTfConfig();
              case ModelPackage.ROTARY_ENCODER__DEVICE_TYPE:
                  return getDeviceType();
          }
          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.ROTARY_ENCODER__LOGGER:
                  setLogger((Logger) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__UID:
                  setUid((String) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__POLL:
                  setPoll((Boolean) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__ENABLED_A:
                  setEnabledA((AtomicBoolean) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__SUB_ID:
                  setSubId((String) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  setMbrick((MBrickletRotaryEncoder) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__SENSOR_VALUE:
                  setSensorValue((DecimalValue) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__CALLBACK_PERIOD:
                  setCallbackPeriod((Long) newValue);
                  return;
              case ModelPackage.ROTARY_ENCODER__TF_CONFIG:
                  setTfConfig((TFBaseConfiguration) newValue);
                  return;
          }
          super.eSet(featureID, newValue);
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public void eUnset(int featureID) {
          switch (featureID) {
              case ModelPackage.ROTARY_ENCODER__LOGGER:
                  setLogger(LOGGER_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__UID:
                  setUid(UID_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__POLL:
                  setPoll(POLL_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__ENABLED_A:
                  setEnabledA(ENABLED_A_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__SUB_ID:
                  setSubId(SUB_ID_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__MBRICK:
                  setMbrick((MBrickletRotaryEncoder) null);
                  return;
              case ModelPackage.ROTARY_ENCODER__SENSOR_VALUE:
                  setSensorValue((DecimalValue) null);
                  return;
              case ModelPackage.ROTARY_ENCODER__CALLBACK_PERIOD:
                  setCallbackPeriod(CALLBACK_PERIOD_EDEFAULT);
                  return;
              case ModelPackage.ROTARY_ENCODER__TF_CONFIG:
                  setTfConfig((TFBaseConfiguration) null);
                  return;
          }
          super.eUnset(featureID);
      }
  
      /**
       * <!-- begin-user-doc -->
       * <!-- end-user-doc -->
       * 
       * @generated
       */
      @Override
      public boolean eIsSet(int featureID) {
          switch (featureID) {
              case ModelPackage.ROTARY_ENCODER__LOGGER:
                  return LOGGER_EDEFAULT == null ? logger != null : !LOGGER_EDEFAULT.equals(logger);
              case ModelPackage.ROTARY_ENCODER__UID:
                  return UID_EDEFAULT == null ? uid != null : !UID_EDEFAULT.equals(uid);
              case ModelPackage.ROTARY_ENCODER__POLL:
  