blob: 05e7e66fb7c81581f90950b0b4c04f699a7eed77 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.AmaltheaValidations;
import org.eclipse.app4mc.amalthea.model.ModeLabel;
import org.eclipse.app4mc.amalthea.model.ModeLabelAccess;
import org.eclipse.app4mc.amalthea.model.ModeLabelAccessEnum;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.DiagnosticChain;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Mode Label Access</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ModeLabelAccessImpl#getData <em>Data</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ModeLabelAccessImpl#getAccess <em>Access</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ModeLabelAccessImpl#getValue <em>Value</em>}</li>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.ModeLabelAccessImpl#getStep <em>Step</em>}</li>
* </ul>
*
* @generated
*/
public class ModeLabelAccessImpl extends ActivityGraphItemImpl implements ModeLabelAccess {
/**
* The cached value of the '{@link #getData() <em>Data</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getData()
* @generated
* @ordered
*/
protected ModeLabel data;
/**
* The default value of the '{@link #getAccess() <em>Access</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAccess()
* @generated
* @ordered
*/
protected static final ModeLabelAccessEnum ACCESS_EDEFAULT = ModeLabelAccessEnum._UNDEFINED_;
/**
* The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAccess()
* @generated
* @ordered
*/
protected ModeLabelAccessEnum access = ACCESS_EDEFAULT;
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* The default value of the '{@link #getStep() <em>Step</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStep()
* @generated
* @ordered
*/
protected static final int STEP_EDEFAULT = 1;
/**
* The cached value of the '{@link #getStep() <em>Step</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStep()
* @generated
* @ordered
*/
protected int step = STEP_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModeLabelAccessImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getModeLabelAccess();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ModeLabel getData() {
if (data != null && data.eIsProxy()) {
InternalEObject oldData = (InternalEObject)data;
data = (ModeLabel)eResolveProxy(oldData);
if (data != oldData) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, AmaltheaPackage.MODE_LABEL_ACCESS__DATA, oldData, data));
}
}
return data;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModeLabel basicGetData() {
return data;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setData(ModeLabel newData) {
ModeLabel oldData = data;
data = newData;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.MODE_LABEL_ACCESS__DATA, oldData, data));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ModeLabelAccessEnum getAccess() {
return access;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setAccess(ModeLabelAccessEnum newAccess) {
ModeLabelAccessEnum oldAccess = access;
access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.MODE_LABEL_ACCESS__ACCESS, oldAccess, access));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setValue(String newValue) {
String oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.MODE_LABEL_ACCESS__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int getStep() {
return step;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setStep(int newStep) {
int oldStep = step;
step = newStep;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.MODE_LABEL_ACCESS__STEP, oldStep, step));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean validateInvariants(final DiagnosticChain diagnostics, final Map<Object, Object> context) {
return AmaltheaValidations.validateInvariants(this, diagnostics);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.MODE_LABEL_ACCESS__DATA:
if (resolve) return getData();
return basicGetData();
case AmaltheaPackage.MODE_LABEL_ACCESS__ACCESS:
return getAccess();
case AmaltheaPackage.MODE_LABEL_ACCESS__VALUE:
return getValue();
case AmaltheaPackage.MODE_LABEL_ACCESS__STEP:
return getStep();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.MODE_LABEL_ACCESS__DATA:
setData((ModeLabel)newValue);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__ACCESS:
setAccess((ModeLabelAccessEnum)newValue);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__VALUE:
setValue((String)newValue);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__STEP:
setStep((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.MODE_LABEL_ACCESS__DATA:
setData((ModeLabel)null);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__ACCESS:
setAccess(ACCESS_EDEFAULT);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__VALUE:
setValue(VALUE_EDEFAULT);
return;
case AmaltheaPackage.MODE_LABEL_ACCESS__STEP:
setStep(STEP_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.MODE_LABEL_ACCESS__DATA:
return data != null;
case AmaltheaPackage.MODE_LABEL_ACCESS__ACCESS:
return access != ACCESS_EDEFAULT;
case AmaltheaPackage.MODE_LABEL_ACCESS__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case AmaltheaPackage.MODE_LABEL_ACCESS__STEP:
return step != STEP_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
@SuppressWarnings("unchecked")
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case AmaltheaPackage.MODE_LABEL_ACCESS___VALIDATE_INVARIANTS__DIAGNOSTICCHAIN_MAP:
return validateInvariants((DiagnosticChain)arguments.get(0), (Map<Object, Object>)arguments.get(1));
}
return super.eInvoke(operationID, arguments);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (access: ");
result.append(access);
result.append(", value: ");
result.append(value);
result.append(", step: ");
result.append(step);
result.append(')');
return result.toString();
}
} //ModeLabelAccessImpl