blob: 53c899125b45690a064a168ab2890f484f620575 [file] [log] [blame]
/**
* Copyright (c) 2011, 2017 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Joerg Riegel - Initial implementation
*
*/
package org.eclipse.osbp.xtext.statemachine.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.statemachine.FSMActionFieldConcatenation;
import org.eclipse.osbp.xtext.statemachine.FSMActionPeripheralPTAuthorization;
import org.eclipse.osbp.xtext.statemachine.FSMPeripheralDevicePT;
import org.eclipse.osbp.xtext.statemachine.StatemachineDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>FSM Action Peripheral PT Authorization</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralPTAuthorizationImpl#getDevice <em>Device</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.statemachine.impl.FSMActionPeripheralPTAuthorizationImpl#getAmount <em>Amount</em>}</li>
* </ul>
*
* @generated
*/
public class FSMActionPeripheralPTAuthorizationImpl extends FSMLazyResolverImpl implements FSMActionPeripheralPTAuthorization {
/**
* The cached value of the '{@link #getDevice() <em>Device</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDevice()
* @generated
* @ordered
*/
protected FSMPeripheralDevicePT device;
/**
* The cached value of the '{@link #getAmount() <em>Amount</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAmount()
* @generated
* @ordered
*/
protected FSMActionFieldConcatenation amount;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected FSMActionPeripheralPTAuthorizationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return StatemachineDSLPackage.Literals.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDevicePT getDevice() {
if (device != null && device.eIsProxy()) {
InternalEObject oldDevice = (InternalEObject)device;
device = (FSMPeripheralDevicePT)eResolveProxy(oldDevice);
if (device != oldDevice) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE, oldDevice, device));
}
}
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMPeripheralDevicePT basicGetDevice() {
return device;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDevice(FSMPeripheralDevicePT newDevice) {
FSMPeripheralDevicePT oldDevice = device;
device = newDevice;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE, oldDevice, device));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public FSMActionFieldConcatenation getAmount() {
return amount;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetAmount(FSMActionFieldConcatenation newAmount, NotificationChain msgs) {
FSMActionFieldConcatenation oldAmount = amount;
amount = newAmount;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT, oldAmount, newAmount);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAmount(FSMActionFieldConcatenation newAmount) {
if (newAmount != amount) {
NotificationChain msgs = null;
if (amount != null)
msgs = ((InternalEObject)amount).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT, null, msgs);
if (newAmount != null)
msgs = ((InternalEObject)newAmount).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT, null, msgs);
msgs = basicSetAmount(newAmount, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT, newAmount, newAmount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT:
return basicSetAmount(null, 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 StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE:
if (resolve) return getDevice();
return basicGetDevice();
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT:
return getAmount();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE:
setDevice((FSMPeripheralDevicePT)newValue);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT:
setAmount((FSMActionFieldConcatenation)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE:
setDevice((FSMPeripheralDevicePT)null);
return;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT:
setAmount((FSMActionFieldConcatenation)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__DEVICE:
return device != null;
case StatemachineDSLPackage.FSM_ACTION_PERIPHERAL_PT_AUTHORIZATION__AMOUNT:
return amount != null;
}
return super.eIsSet(featureID);
}
} //FSMActionPeripheralPTAuthorizationImpl