blob: 04c94c0e4912252c2448d61f82af6871609ace0d [file] [log] [blame]
/**
* Copyright (c) 2018 CEA
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jérémie Tatibouet (CEA) jeremie.tatibouet@cea.fr - Initial API and implementation
* Benoit Maggi (CEA) benoit.maggi@cea.fr - Initial API and implementation
*
*/
package org.eclipse.papyrus.iotml.software.artefact.impl;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.BasicDiagnostic;
import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.common.util.DiagnosticChain;
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.emf.ecore.plugin.EcorePlugin;
import org.eclipse.emf.ecore.util.EObjectValidator;
import org.eclipse.papyrus.iotml.software.artefact.ArtefactPackage;
import org.eclipse.papyrus.iotml.software.artefact.ProvideResource;
import org.eclipse.papyrus.iotml.software.artefact.util.ArtefactValidator;
import org.eclipse.uml2.uml.Association;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Provide Resource</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.iotml.software.artefact.impl.ProvideResourceImpl#getBase_Association <em>Base Association</em>}</li>
* </ul>
*
* @generated
*/
public class ProvideResourceImpl extends MinimalEObjectImpl.Container implements ProvideResource {
/**
* The cached value of the '{@link #getBase_Association() <em>Base Association</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getBase_Association()
* @generated
* @ordered
*/
protected Association base_Association;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ProvideResourceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArtefactPackage.Literals.PROVIDE_RESOURCE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Association getBase_Association() {
if (base_Association != null && base_Association.eIsProxy()) {
InternalEObject oldBase_Association = (InternalEObject)base_Association;
base_Association = (Association)eResolveProxy(oldBase_Association);
if (base_Association != oldBase_Association) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION, oldBase_Association, base_Association));
}
}
return base_Association;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Association basicGetBase_Association() {
return base_Association;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setBase_Association(Association newBase_Association) {
Association oldBase_Association = base_Association;
base_Association = newBase_Association;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION, oldBase_Association, base_Association));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ProvideResource_C1(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
ArtefactValidator.DIAGNOSTIC_SOURCE,
ArtefactValidator.PROVIDE_RESOURCE__PROVIDE_RESOURCE_C1,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ProvideResource_C1", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean ProvideResource_C2(DiagnosticChain diagnostics, Map<Object, Object> context) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
ArtefactValidator.DIAGNOSTIC_SOURCE,
ArtefactValidator.PROVIDE_RESOURCE__PROVIDE_RESOURCE_C2,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "ProvideResource_C2", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION:
if (resolve) return getBase_Association();
return basicGetBase_Association();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION:
setBase_Association((Association)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION:
setBase_Association((Association)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArtefactPackage.PROVIDE_RESOURCE__BASE_ASSOCIATION:
return base_Association != null;
}
return super.eIsSet(featureID);
}
} //ProvideResourceImpl