blob: 6de537dbce2a66a2b610b407a04916a2026607ab [file] [log] [blame]
/**
* Copyright (c) 2018, IncQuery Labs Ltd and 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:
* IncQuery Labs Ltd - initial API and implementation
* CEA List
*/
package org.eclipse.papyrus.moka.ssp.profile.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.moka.ssp.profile.SSPProfilePackage;
import org.eclipse.papyrus.moka.ssp.profile.Ssd;
import org.eclipse.papyrus.moka.ssp.profile.SsdSystem;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ssd</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.moka.ssp.profile.impl.SsdImpl#getBase_Package <em>Base Package</em>}</li>
* <li>{@link org.eclipse.papyrus.moka.ssp.profile.impl.SsdImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.papyrus.moka.ssp.profile.impl.SsdImpl#getVersion <em>Version</em>}</li>
* <li>{@link org.eclipse.papyrus.moka.ssp.profile.impl.SsdImpl#getMainSystem <em>Main System</em>}</li>
* </ul>
*
* @generated
*/
public class SsdImpl extends MinimalEObjectImpl.Container implements Ssd {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static final String copyright = " Copyright (c) 2018, IncQuery Labs Ltd and CEA List.\n All rights reserved. This program and the accompanying materials\nare made available under the terms of the Eclipse Public License 2.0\nwhich accompanies this distribution, and is available at\nhttps://www.eclipse.org/legal/epl-2.0 \r\n\r\nSPDX-License-Identifier: EPL-2.0\n \nContributors:\n IncQuery Labs Ltd - initial API and implementation\n CEA List ";
/**
* The cached value of the '{@link #getBase_Package() <em>Base Package</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Package()
* @generated
* @ordered
*/
protected org.eclipse.uml2.uml.Package base_Package;
/**
* 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 #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected static final String VERSION_EDEFAULT = null;
/**
* The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getVersion()
* @generated
* @ordered
*/
protected String version = VERSION_EDEFAULT;
/**
* The cached value of the '{@link #getMainSystem() <em>Main System</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMainSystem()
* @generated
* @ordered
*/
protected SsdSystem mainSystem;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SsdImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return SSPProfilePackage.Literals.SSD;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.uml2.uml.Package getBase_Package() {
if (base_Package != null && base_Package.eIsProxy()) {
InternalEObject oldBase_Package = (InternalEObject)base_Package;
base_Package = (org.eclipse.uml2.uml.Package)eResolveProxy(oldBase_Package);
if (base_Package != oldBase_Package) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SSPProfilePackage.SSD__BASE_PACKAGE, oldBase_Package, base_Package));
}
}
return base_Package;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public org.eclipse.uml2.uml.Package basicGetBase_Package() {
return base_Package;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Package(org.eclipse.uml2.uml.Package newBase_Package) {
org.eclipse.uml2.uml.Package oldBase_Package = base_Package;
base_Package = newBase_Package;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SSPProfilePackage.SSD__BASE_PACKAGE, oldBase_Package, base_Package));
}
/**
* <!-- 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, SSPProfilePackage.SSD__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getVersion() {
return version;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVersion(String newVersion) {
String oldVersion = version;
version = newVersion;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SSPProfilePackage.SSD__VERSION, oldVersion, version));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SsdSystem getMainSystem() {
if (mainSystem != null && mainSystem.eIsProxy()) {
InternalEObject oldMainSystem = (InternalEObject)mainSystem;
mainSystem = (SsdSystem)eResolveProxy(oldMainSystem);
if (mainSystem != oldMainSystem) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, SSPProfilePackage.SSD__MAIN_SYSTEM, oldMainSystem, mainSystem));
}
}
return mainSystem;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public SsdSystem basicGetMainSystem() {
return mainSystem;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMainSystem(SsdSystem newMainSystem) {
SsdSystem oldMainSystem = mainSystem;
mainSystem = newMainSystem;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SSPProfilePackage.SSD__MAIN_SYSTEM, oldMainSystem, mainSystem));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case SSPProfilePackage.SSD__BASE_PACKAGE:
if (resolve) return getBase_Package();
return basicGetBase_Package();
case SSPProfilePackage.SSD__NAME:
return getName();
case SSPProfilePackage.SSD__VERSION:
return getVersion();
case SSPProfilePackage.SSD__MAIN_SYSTEM:
if (resolve) return getMainSystem();
return basicGetMainSystem();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case SSPProfilePackage.SSD__BASE_PACKAGE:
setBase_Package((org.eclipse.uml2.uml.Package)newValue);
return;
case SSPProfilePackage.SSD__NAME:
setName((String)newValue);
return;
case SSPProfilePackage.SSD__VERSION:
setVersion((String)newValue);
return;
case SSPProfilePackage.SSD__MAIN_SYSTEM:
setMainSystem((SsdSystem)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case SSPProfilePackage.SSD__BASE_PACKAGE:
setBase_Package((org.eclipse.uml2.uml.Package)null);
return;
case SSPProfilePackage.SSD__NAME:
setName(NAME_EDEFAULT);
return;
case SSPProfilePackage.SSD__VERSION:
setVersion(VERSION_EDEFAULT);
return;
case SSPProfilePackage.SSD__MAIN_SYSTEM:
setMainSystem((SsdSystem)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case SSPProfilePackage.SSD__BASE_PACKAGE:
return base_Package != null;
case SSPProfilePackage.SSD__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case SSPProfilePackage.SSD__VERSION:
return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
case SSPProfilePackage.SSD__MAIN_SYSTEM:
return mainSystem != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", version: ");
result.append(version);
result.append(')');
return result.toString();
}
} //SsdImpl