blob: 49ea9bb4e19e507d5394e2e1314e7ebb3e7cee90 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2022 CEA LIST.
*
* 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
*
* Contributors:
* Saadia Dhouib (CEA LIST) saadia.dhouib@cea.fr
* Fadwa Tmar (CEA LIST) fadwa.tmar@cea.fr
*******************************************************************************/
/**
*/
package org.eclipse.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.impl;
import org.eclipse.emf.common.notify.Notification;
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.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.EmergencyStopFunctionType;
import org.eclipse.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.OPCUARoboticsProfilePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Emergency Stop Function Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.impl.EmergencyStopFunctionTypeImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.impl.EmergencyStopFunctionTypeImpl#isActive <em>Active</em>}</li>
* <li>{@link org.eclipse.papyrus.ocpua.robotics.profile.opcuaroboticsprofile.impl.EmergencyStopFunctionTypeImpl#getBase_Class <em>Base Class</em>}</li>
* </ul>
*
* @generated
*/
public class EmergencyStopFunctionTypeImpl extends MinimalEObjectImpl.Container implements EmergencyStopFunctionType {
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #isActive() <em>Active</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isActive()
* @generated
* @ordered
*/
protected static final boolean ACTIVE_EDEFAULT = false;
/**
* The cached value of the '{@link #isActive() <em>Active</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isActive()
* @generated
* @ordered
*/
protected boolean active = ACTIVE_EDEFAULT;
/**
* The cached value of the '{@link #getBase_Class() <em>Base Class</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Class()
* @generated
* @ordered
*/
protected org.eclipse.uml2.uml.Class base_Class;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EmergencyStopFunctionTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OPCUARoboticsProfilePackage.Literals.EMERGENCY_STOP_FUNCTION_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isActive() {
return active;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setActive(boolean newActive) {
boolean oldActive = active;
active = newActive;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__ACTIVE, oldActive, active));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.uml2.uml.Class getBase_Class() {
if (base_Class != null && base_Class.eIsProxy()) {
InternalEObject oldBase_Class = (InternalEObject)base_Class;
base_Class = (org.eclipse.uml2.uml.Class)eResolveProxy(oldBase_Class);
if (base_Class != oldBase_Class) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS, oldBase_Class, base_Class));
}
}
return base_Class;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.uml2.uml.Class basicGetBase_Class() {
return base_Class;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Class(org.eclipse.uml2.uml.Class newBase_Class) {
org.eclipse.uml2.uml.Class oldBase_Class = base_Class;
base_Class = newBase_Class;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS, oldBase_Class, base_Class));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__NAME:
return getName();
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__ACTIVE:
return isActive();
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS:
if (resolve) return getBase_Class();
return basicGetBase_Class();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__NAME:
setName((String)newValue);
return;
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__ACTIVE:
setActive((Boolean)newValue);
return;
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS:
setBase_Class((org.eclipse.uml2.uml.Class)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__NAME:
setName(NAME_EDEFAULT);
return;
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__ACTIVE:
setActive(ACTIVE_EDEFAULT);
return;
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS:
setBase_Class((org.eclipse.uml2.uml.Class)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__ACTIVE:
return active != ACTIVE_EDEFAULT;
case OPCUARoboticsProfilePackage.EMERGENCY_STOP_FUNCTION_TYPE__BASE_CLASS:
return base_Class != null;
}
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(" (Name: ");
result.append(name);
result.append(", Active: ");
result.append(active);
result.append(')');
return result.toString();
}
} //EmergencyStopFunctionTypeImpl