blob: eb8ec229456046e499648a1a1dc65fb4e5e4bf95 [file] [log] [blame]
/**
* Copyright (c) 2017 CEA LIST.
*
* 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:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
package org.eclipse.efm.execution.core.workflow.common.impl;
import org.eclipse.efm.execution.core.workflow.common.CommonPackage;
import org.eclipse.efm.execution.core.workflow.common.TraceElement;
import org.eclipse.efm.execution.core.workflow.common.TraceElementKind;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Trace Element</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.efm.execution.core.workflow.common.impl.TraceElementImpl#getNature <em>Nature</em>}</li>
* <li>{@link org.eclipse.efm.execution.core.workflow.common.impl.TraceElementImpl#getValue <em>Value</em>}</li>
* </ul>
*
* @generated
*/
public class TraceElementImpl extends MinimalEObjectImpl.Container implements TraceElement {
/**
* The default value of the '{@link #getNature() <em>Nature</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNature()
* @generated
* @ordered
*/
protected static final TraceElementKind NATURE_EDEFAULT = TraceElementKind.UNDEFINED;
/**
* The cached value of the '{@link #getNature() <em>Nature</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNature()
* @generated
* @ordered
*/
protected TraceElementKind nature = NATURE_EDEFAULT;
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final Object VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected Object value = VALUE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TraceElementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CommonPackage.Literals.TRACE_ELEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TraceElementKind getNature() {
return nature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNature(TraceElementKind newNature) {
TraceElementKind oldNature = nature;
nature = newNature == null ? NATURE_EDEFAULT : newNature;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.TRACE_ELEMENT__NATURE, oldNature, nature));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(Object newValue) {
Object oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.TRACE_ELEMENT__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CommonPackage.TRACE_ELEMENT__NATURE:
return getNature();
case CommonPackage.TRACE_ELEMENT__VALUE:
return getValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CommonPackage.TRACE_ELEMENT__NATURE:
setNature((TraceElementKind)newValue);
return;
case CommonPackage.TRACE_ELEMENT__VALUE:
setValue(newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CommonPackage.TRACE_ELEMENT__NATURE:
setNature(NATURE_EDEFAULT);
return;
case CommonPackage.TRACE_ELEMENT__VALUE:
setValue(VALUE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CommonPackage.TRACE_ELEMENT__NATURE:
return nature != NATURE_EDEFAULT;
case CommonPackage.TRACE_ELEMENT__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (nature: ");
result.append(nature);
result.append(", value: ");
result.append(value);
result.append(')');
return result.toString();
}
} //TraceElementImpl