blob: 5d5b4536e94edfbff6478255153dc621169ed9d1 [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.opcua.di.opcuadiprofile.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.papyrus.opcua.di.opcuadiprofile.ITagNameplateType;
import org.eclipse.papyrus.opcua.di.opcuadiprofile.OPCUADIProfilePackage;
import org.eclipse.papyrus.opcua.opcuaprofile.OPC_UA_Library.LocalizedText;
import org.eclipse.papyrus.opcua.opcuaprofile.impl.BaseInterfaceTypeImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>ITag Nameplate Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.opcua.di.opcuadiprofile.impl.ITagNameplateTypeImpl#getAssetId <em>Asset Id</em>}</li>
* <li>{@link org.eclipse.papyrus.opcua.di.opcuadiprofile.impl.ITagNameplateTypeImpl#getComponentName <em>Component Name</em>}</li>
* </ul>
*
* @generated
*/
public abstract class ITagNameplateTypeImpl extends BaseInterfaceTypeImpl implements ITagNameplateType {
/**
* The default value of the '{@link #getAssetId() <em>Asset Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAssetId()
* @generated
* @ordered
*/
protected static final String ASSET_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getAssetId() <em>Asset Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAssetId()
* @generated
* @ordered
*/
protected String assetId = ASSET_ID_EDEFAULT;
/**
* The cached value of the '{@link #getComponentName() <em>Component Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getComponentName()
* @generated
* @ordered
*/
protected LocalizedText componentName;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ITagNameplateTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return OPCUADIProfilePackage.Literals.ITAG_NAMEPLATE_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getAssetId() {
return assetId;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAssetId(String newAssetId) {
String oldAssetId = assetId;
assetId = newAssetId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__ASSET_ID, oldAssetId, assetId));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LocalizedText getComponentName() {
return componentName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetComponentName(LocalizedText newComponentName, NotificationChain msgs) {
LocalizedText oldComponentName = componentName;
componentName = newComponentName;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME, oldComponentName, newComponentName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setComponentName(LocalizedText newComponentName) {
if (newComponentName != componentName) {
NotificationChain msgs = null;
if (componentName != null)
msgs = ((InternalEObject)componentName).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME, null, msgs);
if (newComponentName != null)
msgs = ((InternalEObject)newComponentName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME, null, msgs);
msgs = basicSetComponentName(newComponentName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME, newComponentName, newComponentName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME:
return basicSetComponentName(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 OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__ASSET_ID:
return getAssetId();
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME:
return getComponentName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__ASSET_ID:
setAssetId((String)newValue);
return;
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME:
setComponentName((LocalizedText)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__ASSET_ID:
setAssetId(ASSET_ID_EDEFAULT);
return;
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME:
setComponentName((LocalizedText)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__ASSET_ID:
return ASSET_ID_EDEFAULT == null ? assetId != null : !ASSET_ID_EDEFAULT.equals(assetId);
case OPCUADIProfilePackage.ITAG_NAMEPLATE_TYPE__COMPONENT_NAME:
return componentName != 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(" (AssetId: ");
result.append(assetId);
result.append(')');
return result.toString();
}
} //ITagNameplateTypeImpl