blob: bee7986dbb58eb94b6c3c91793b2a82107df9f9d [file] [log] [blame]
/**
*/
package IoTML.Hardware.Core.impl;
import IoTML.Hardware.Core.CorePackage;
import IoTML.Hardware.Core.HasService;
import IoTML.Hardware.Core.util.CoreValidator;
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.uml2.uml.Association;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Has Service</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link IoTML.Hardware.Core.impl.HasServiceImpl#getBase_Association <em>Base Association</em>}</li>
* </ul>
*
* @generated
*/
public class HasServiceImpl extends MinimalEObjectImpl.Container implements HasService {
/**
* 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 HasServiceImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return CorePackage.Literals.HAS_SERVICE;
}
/**
* <!-- 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, CorePackage.HAS_SERVICE__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, CorePackage.HAS_SERVICE__BASE_ASSOCIATION, oldBase_Association, base_Association));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean HasDevice_C1(DiagnosticChain diagnostics, Map 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,
CoreValidator.DIAGNOSTIC_SOURCE,
CoreValidator.HAS_SERVICE__HAS_DEVICE_C1,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "HasDevice_C1", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean HasDevice_C2(DiagnosticChain diagnostics, Map 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,
CoreValidator.DIAGNOSTIC_SOURCE,
CoreValidator.HAS_SERVICE__HAS_DEVICE_C2,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "HasDevice_C2", EObjectValidator.getObjectLabel(this, context) }),
new Object [] { this }));
}
return false;
}
return true;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CorePackage.HAS_SERVICE__BASE_ASSOCIATION:
if (resolve) return getBase_Association();
return basicGetBase_Association();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CorePackage.HAS_SERVICE__BASE_ASSOCIATION:
setBase_Association((Association)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case CorePackage.HAS_SERVICE__BASE_ASSOCIATION:
setBase_Association((Association)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case CorePackage.HAS_SERVICE__BASE_ASSOCIATION:
return base_Association != null;
}
return super.eIsSet(featureID);
}
} //HasServiceImpl