/**
*/
package de.gebit.integrity.dsl.impl;
import de.gebit.integrity.dsl.DslPackage;
import de.gebit.integrity.dsl.SuiteParameterDefinition;
import de.gebit.integrity.dsl.ValueOrEnumValueOrOperationCollection;
import de.gebit.integrity.dsl.VariableEntity;
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.MinimalEObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Suite Parameter Definition</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link de.gebit.integrity.dsl.impl.SuiteParameterDefinitionImpl#getName <em>Name</em>}</li>
* <li>{@link de.gebit.integrity.dsl.impl.SuiteParameterDefinitionImpl#getDefault <em>Default</em>}</li>
* </ul>
*
* @generated
*/
public class SuiteParameterDefinitionImpl extends MinimalEObjectImpl.Container implements SuiteParameterDefinition
{
/**
* The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected VariableEntity name;
/**
* The cached value of the '{@link #getDefault() <em>Default</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDefault()
* @generated
* @ordered
*/
protected ValueOrEnumValueOrOperationCollection default_;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected SuiteParameterDefinitionImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return DslPackage.Literals.SUITE_PARAMETER_DEFINITION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VariableEntity getName()
{
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetName(VariableEntity newName, NotificationChain msgs)
{
VariableEntity oldName = name;
name = newName;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DslPackage.SUITE_PARAMETER_DEFINITION__NAME, oldName, newName);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(VariableEntity newName)
{
if (newName != name)
{
NotificationChain msgs = null;
if (name != null)
msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DslPackage.SUITE_PARAMETER_DEFINITION__NAME, null, msgs);
if (newName != null)
msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DslPackage.SUITE_PARAMETER_DEFINITION__NAME, null, msgs);
msgs = basicSetName(newName, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.SUITE_PARAMETER_DEFINITION__NAME, newName, newName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueOrEnumValueOrOperationCollection getDefault()
{
return default_;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDefault(ValueOrEnumValueOrOperationCollection newDefault, NotificationChain msgs)
{
ValueOrEnumValueOrOperationCollection oldDefault = default_;
default_ = newDefault;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT, oldDefault, newDefault);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefault(ValueOrEnumValueOrOperationCollection newDefault)
{
if (newDefault != default_)
{
NotificationChain msgs = null;
if (default_ != null)
msgs = ((InternalEObject)default_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT, null, msgs);
if (newDefault != null)
msgs = ((InternalEObject)newDefault).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT, null, msgs);
msgs = basicSetDefault(newDefault, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT, newDefault, newDefault));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case DslPackage.SUITE_PARAMETER_DEFINITION__NAME:
return basicSetName(null, msgs);
case DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT:
return basicSetDefault(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case DslPackage.SUITE_PARAMETER_DEFINITION__NAME:
return getName();
case DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT:
return getDefault();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case DslPackage.SUITE_PARAMETER_DEFINITION__NAME:
setName((VariableEntity)newValue);
return;
case DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT:
setDefault((ValueOrEnumValueOrOperationCollection)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case DslPackage.SUITE_PARAMETER_DEFINITION__NAME:
setName((VariableEntity)null);
return;
case DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT:
setDefault((ValueOrEnumValueOrOperationCollection)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case DslPackage.SUITE_PARAMETER_DEFINITION__NAME:
return name != null;
case DslPackage.SUITE_PARAMETER_DEFINITION__DEFAULT:
return default_ != null;
}
return super.eIsSet(featureID);
}
} //SuiteParameterDefinitionImpl