/**
*/
package com.robotoworks.mechanoid.net.netModel.impl;
import com.robotoworks.mechanoid.net.netModel.BlockType;
import com.robotoworks.mechanoid.net.netModel.ComplexTypeDeclaration;
import com.robotoworks.mechanoid.net.netModel.NetModelPackage;
import com.robotoworks.mechanoid.net.netModel.ResponseBlock;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Response Block</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link com.robotoworks.mechanoid.net.netModel.impl.ResponseBlockImpl#getSuperType <em>Super Type</em>}</li>
* <li>{@link com.robotoworks.mechanoid.net.netModel.impl.ResponseBlockImpl#getType <em>Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ResponseBlockImpl extends HttpMethodBlockImpl implements ResponseBlock
{
/**
* The cached value of the '{@link #getSuperType() <em>Super Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSuperType()
* @generated
* @ordered
*/
protected ComplexTypeDeclaration superType;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected BlockType type;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ResponseBlockImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return NetModelPackage.Literals.RESPONSE_BLOCK;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComplexTypeDeclaration getSuperType()
{
if (superType != null && superType.eIsProxy())
{
InternalEObject oldSuperType = (InternalEObject)superType;
superType = (ComplexTypeDeclaration)eResolveProxy(oldSuperType);
if (superType != oldSuperType)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE, oldSuperType, superType));
}
}
return superType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ComplexTypeDeclaration basicGetSuperType()
{
return superType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSuperType(ComplexTypeDeclaration newSuperType)
{
ComplexTypeDeclaration oldSuperType = superType;
superType = newSuperType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE, oldSuperType, superType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public BlockType getType()
{
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetType(BlockType newType, NotificationChain msgs)
{
BlockType oldType = type;
type = newType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, NetModelPackage.RESPONSE_BLOCK__TYPE, oldType, newType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(BlockType newType)
{
if (newType != type)
{
NotificationChain msgs = null;
if (type != null)
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - NetModelPackage.RESPONSE_BLOCK__TYPE, null, msgs);
if (newType != null)
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - NetModelPackage.RESPONSE_BLOCK__TYPE, null, msgs);
msgs = basicSetType(newType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, NetModelPackage.RESPONSE_BLOCK__TYPE, newType, newType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case NetModelPackage.RESPONSE_BLOCK__TYPE:
return basicSetType(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 NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE:
if (resolve) return getSuperType();
return basicGetSuperType();
case NetModelPackage.RESPONSE_BLOCK__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE:
setSuperType((ComplexTypeDeclaration)newValue);
return;
case NetModelPackage.RESPONSE_BLOCK__TYPE:
setType((BlockType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE:
setSuperType((ComplexTypeDeclaration)null);
return;
case NetModelPackage.RESPONSE_BLOCK__TYPE:
setType((BlockType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case NetModelPackage.RESPONSE_BLOCK__SUPER_TYPE:
return superType != null;
case NetModelPackage.RESPONSE_BLOCK__TYPE:
return type != null;
}
return super.eIsSet(featureID);
}
} //ResponseBlockImpl