/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.talend.core.model.properties.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.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.talend.core.model.properties.ExecutionTask;
import org.talend.core.model.properties.ExecutionTaskCmdPrm;
import org.talend.core.model.properties.PropertiesPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Execution Task Cmd Prm</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.talend.core.model.properties.impl.ExecutionTaskCmdPrmImpl#getId <em>Id</em>}</li>
* <li>{@link org.talend.core.model.properties.impl.ExecutionTaskCmdPrmImpl#isActive <em>Active</em>}</li>
* <li>{@link org.talend.core.model.properties.impl.ExecutionTaskCmdPrmImpl#getParameter <em>Parameter</em>}</li>
* <li>{@link org.talend.core.model.properties.impl.ExecutionTaskCmdPrmImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.talend.core.model.properties.impl.ExecutionTaskCmdPrmImpl#getExecutionTask <em>Execution Task</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ExecutionTaskCmdPrmImpl extends EObjectImpl implements ExecutionTaskCmdPrm {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected int id = ID_EDEFAULT;
/**
* The default value of the '{@link #isActive() <em>Active</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isActive()
* @generated
* @ordered
*/
protected static final boolean ACTIVE_EDEFAULT = false;
/**
* The cached value of the '{@link #isActive() <em>Active</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isActive()
* @generated
* @ordered
*/
protected boolean active = ACTIVE_EDEFAULT;
/**
* The default value of the '{@link #getParameter() <em>Parameter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParameter()
* @generated
* @ordered
*/
protected static final String PARAMETER_EDEFAULT = null;
/**
* The cached value of the '{@link #getParameter() <em>Parameter</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParameter()
* @generated
* @ordered
*/
protected String parameter = PARAMETER_EDEFAULT;
/**
* The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescription()
* @generated
* @ordered
*/
protected String description = DESCRIPTION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ExecutionTaskCmdPrmImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return PropertiesPackage.Literals.EXECUTION_TASK_CMD_PRM;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.EXECUTION_TASK_CMD_PRM__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isActive() {
return active;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setActive(boolean newActive) {
boolean oldActive = active;
active = newActive;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.EXECUTION_TASK_CMD_PRM__ACTIVE, oldActive, active));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getParameter() {
return parameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParameter(String newParameter) {
String oldParameter = parameter;
parameter = newParameter;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.EXECUTION_TASK_CMD_PRM__PARAMETER, oldParameter, parameter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(String newDescription) {
String oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.EXECUTION_TASK_CMD_PRM__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ExecutionTask getExecutionTask() {
if (eContainerFeatureID() != PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK) return null;
return (ExecutionTask)eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetExecutionTask(ExecutionTask newExecutionTask, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject)newExecutionTask, PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK, msgs);
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setExecutionTask(ExecutionTask newExecutionTask) {
if (newExecutionTask != eInternalContainer() || (eContainerFeatureID() != PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK && newExecutionTask != null)) {
if (EcoreUtil.isAncestor(this, newExecutionTask))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newExecutionTask != null)
msgs = ((InternalEObject)newExecutionTask).eInverseAdd(this, PropertiesPackage.EXECUTION_TASK__CMD_PRMS, ExecutionTask.class, msgs);
msgs = basicSetExecutionTask(newExecutionTask, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK, newExecutionTask, newExecutionTask));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetExecutionTask((ExecutionTask)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
return basicSetExecutionTask(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
switch (eContainerFeatureID()) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
return eInternalContainer().eInverseRemove(this, PropertiesPackage.EXECUTION_TASK__CMD_PRMS, ExecutionTask.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ID:
return new Integer(getId());
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ACTIVE:
return isActive() ? Boolean.TRUE : Boolean.FALSE;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__PARAMETER:
return getParameter();
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__DESCRIPTION:
return getDescription();
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
return getExecutionTask();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ID:
setId(((Integer)newValue).intValue());
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ACTIVE:
setActive(((Boolean)newValue).booleanValue());
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__PARAMETER:
setParameter((String)newValue);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__DESCRIPTION:
setDescription((String)newValue);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
setExecutionTask((ExecutionTask)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ID:
setId(ID_EDEFAULT);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ACTIVE:
setActive(ACTIVE_EDEFAULT);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__PARAMETER:
setParameter(PARAMETER_EDEFAULT);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
setExecutionTask((ExecutionTask)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ID:
return id != ID_EDEFAULT;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__ACTIVE:
return active != ACTIVE_EDEFAULT;
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__PARAMETER:
return PARAMETER_EDEFAULT == null ? parameter != null : !PARAMETER_EDEFAULT.equals(parameter);
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__DESCRIPTION:
return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
case PropertiesPackage.EXECUTION_TASK_CMD_PRM__EXECUTION_TASK:
return getExecutionTask() != null;
}
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(" (id: ");
result.append(id);
result.append(", active: ");
result.append(active);
result.append(", parameter: ");
result.append(parameter);
result.append(", description: ");
result.append(description);
result.append(')');
return result.toString();
}
} //ExecutionTaskCmdPrmImpl