org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.20.0
*/
package org.contextmapper.tactic.dsl.tacticdsl.impl;
import java.util.Collection;
import org.contextmapper.tactic.dsl.tacticdsl.ComplexType;
import org.contextmapper.tactic.dsl.tacticdsl.HttpMethod;
import org.contextmapper.tactic.dsl.tacticdsl.Parameter;
import org.contextmapper.tactic.dsl.tacticdsl.ResourceOperation;
import org.contextmapper.tactic.dsl.tacticdsl.ResourceOperationDelegate;
import org.contextmapper.tactic.dsl.tacticdsl.TacticdslPackage;
import org.contextmapper.tactic.dsl.tacticdsl.Visibility;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Resource Operation'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getDoc Doc}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getVisibility Visibility}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getReturnType Return Type}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getName Name}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getParameters Parameters}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getThrows Throws}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getHint Hint}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getHttpMethod Http Method}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getPath Path}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getReturnString Return String}
* - {@link org.contextmapper.tactic.dsl.tacticdsl.impl.ResourceOperationImpl#getDelegateHolder Delegate Holder}
*
*
* @generated
*/
public class ResourceOperationImpl extends MinimalEObjectImpl.Container implements ResourceOperation
{
/**
* The default value of the '{@link #getDoc() Doc}' attribute.
*
*
* @see #getDoc()
* @generated
* @ordered
*/
protected static final String DOC_EDEFAULT = null;
/**
* The cached value of the '{@link #getDoc() Doc}' attribute.
*
*
* @see #getDoc()
* @generated
* @ordered
*/
protected String doc = DOC_EDEFAULT;
/**
* The default value of the '{@link #getVisibility() Visibility}' attribute.
*
*
* @see #getVisibility()
* @generated
* @ordered
*/
protected static final Visibility VISIBILITY_EDEFAULT = Visibility.PUBLIC;
/**
* The cached value of the '{@link #getVisibility() Visibility}' attribute.
*
*
* @see #getVisibility()
* @generated
* @ordered
*/
protected Visibility visibility = VISIBILITY_EDEFAULT;
/**
* The cached value of the '{@link #getReturnType() Return Type}' containment reference.
*
*
* @see #getReturnType()
* @generated
* @ordered
*/
protected ComplexType returnType;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getParameters() Parameters}' containment reference list.
*
*
* @see #getParameters()
* @generated
* @ordered
*/
protected EList parameters;
/**
* The default value of the '{@link #getThrows() Throws}' attribute.
*
*
* @see #getThrows()
* @generated
* @ordered
*/
protected static final String THROWS_EDEFAULT = null;
/**
* The cached value of the '{@link #getThrows() Throws}' attribute.
*
*
* @see #getThrows()
* @generated
* @ordered
*/
protected String throws_ = THROWS_EDEFAULT;
/**
* The default value of the '{@link #getHint() Hint}' attribute.
*
*
* @see #getHint()
* @generated
* @ordered
*/
protected static final String HINT_EDEFAULT = null;
/**
* The cached value of the '{@link #getHint() Hint}' attribute.
*
*
* @see #getHint()
* @generated
* @ordered
*/
protected String hint = HINT_EDEFAULT;
/**
* The default value of the '{@link #getHttpMethod() Http Method}' attribute.
*
*
* @see #getHttpMethod()
* @generated
* @ordered
*/
protected static final HttpMethod HTTP_METHOD_EDEFAULT = HttpMethod.NONE;
/**
* The cached value of the '{@link #getHttpMethod() Http Method}' attribute.
*
*
* @see #getHttpMethod()
* @generated
* @ordered
*/
protected HttpMethod httpMethod = HTTP_METHOD_EDEFAULT;
/**
* The default value of the '{@link #getPath() Path}' attribute.
*
*
* @see #getPath()
* @generated
* @ordered
*/
protected static final String PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getPath() Path}' attribute.
*
*
* @see #getPath()
* @generated
* @ordered
*/
protected String path = PATH_EDEFAULT;
/**
* The default value of the '{@link #getReturnString() Return String}' attribute.
*
*
* @see #getReturnString()
* @generated
* @ordered
*/
protected static final String RETURN_STRING_EDEFAULT = null;
/**
* The cached value of the '{@link #getReturnString() Return String}' attribute.
*
*
* @see #getReturnString()
* @generated
* @ordered
*/
protected String returnString = RETURN_STRING_EDEFAULT;
/**
* The cached value of the '{@link #getDelegateHolder() Delegate Holder}' containment reference.
*
*
* @see #getDelegateHolder()
* @generated
* @ordered
*/
protected ResourceOperationDelegate delegateHolder;
/**
*
*
* @generated
*/
protected ResourceOperationImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return TacticdslPackage.Literals.RESOURCE_OPERATION;
}
/**
*
*
* @generated
*/
public String getDoc()
{
return doc;
}
/**
*
*
* @generated
*/
public void setDoc(String newDoc)
{
String oldDoc = doc;
doc = newDoc;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__DOC, oldDoc, doc));
}
/**
*
*
* @generated
*/
public Visibility getVisibility()
{
return visibility;
}
/**
*
*
* @generated
*/
public void setVisibility(Visibility newVisibility)
{
Visibility oldVisibility = visibility;
visibility = newVisibility == null ? VISIBILITY_EDEFAULT : newVisibility;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__VISIBILITY, oldVisibility, visibility));
}
/**
*
*
* @generated
*/
public ComplexType getReturnType()
{
return returnType;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetReturnType(ComplexType newReturnType, NotificationChain msgs)
{
ComplexType oldReturnType = returnType;
returnType = newReturnType;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE, oldReturnType, newReturnType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setReturnType(ComplexType newReturnType)
{
if (newReturnType != returnType)
{
NotificationChain msgs = null;
if (returnType != null)
msgs = ((InternalEObject)returnType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE, null, msgs);
if (newReturnType != null)
msgs = ((InternalEObject)newReturnType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE, null, msgs);
msgs = basicSetReturnType(newReturnType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE, newReturnType, newReturnType));
}
/**
*
*
* @generated
*/
public String getName()
{
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName)
{
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public EList getParameters()
{
if (parameters == null)
{
parameters = new EObjectContainmentEList(Parameter.class, this, TacticdslPackage.RESOURCE_OPERATION__PARAMETERS);
}
return parameters;
}
/**
*
*
* @generated
*/
public String getThrows()
{
return throws_;
}
/**
*
*
* @generated
*/
public void setThrows(String newThrows)
{
String oldThrows = throws_;
throws_ = newThrows;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__THROWS, oldThrows, throws_));
}
/**
*
*
* @generated
*/
public String getHint()
{
return hint;
}
/**
*
*
* @generated
*/
public void setHint(String newHint)
{
String oldHint = hint;
hint = newHint;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__HINT, oldHint, hint));
}
/**
*
*
* @generated
*/
public HttpMethod getHttpMethod()
{
return httpMethod;
}
/**
*
*
* @generated
*/
public void setHttpMethod(HttpMethod newHttpMethod)
{
HttpMethod oldHttpMethod = httpMethod;
httpMethod = newHttpMethod == null ? HTTP_METHOD_EDEFAULT : newHttpMethod;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__HTTP_METHOD, oldHttpMethod, httpMethod));
}
/**
*
*
* @generated
*/
public String getPath()
{
return path;
}
/**
*
*
* @generated
*/
public void setPath(String newPath)
{
String oldPath = path;
path = newPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__PATH, oldPath, path));
}
/**
*
*
* @generated
*/
public String getReturnString()
{
return returnString;
}
/**
*
*
* @generated
*/
public void setReturnString(String newReturnString)
{
String oldReturnString = returnString;
returnString = newReturnString;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__RETURN_STRING, oldReturnString, returnString));
}
/**
*
*
* @generated
*/
public ResourceOperationDelegate getDelegateHolder()
{
return delegateHolder;
}
/**
*
*
* @generated
*/
public NotificationChain basicSetDelegateHolder(ResourceOperationDelegate newDelegateHolder, NotificationChain msgs)
{
ResourceOperationDelegate oldDelegateHolder = delegateHolder;
delegateHolder = newDelegateHolder;
if (eNotificationRequired())
{
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER, oldDelegateHolder, newDelegateHolder);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
*
*
* @generated
*/
public void setDelegateHolder(ResourceOperationDelegate newDelegateHolder)
{
if (newDelegateHolder != delegateHolder)
{
NotificationChain msgs = null;
if (delegateHolder != null)
msgs = ((InternalEObject)delegateHolder).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER, null, msgs);
if (newDelegateHolder != null)
msgs = ((InternalEObject)newDelegateHolder).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER, null, msgs);
msgs = basicSetDelegateHolder(newDelegateHolder, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER, newDelegateHolder, newDelegateHolder));
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE:
return basicSetReturnType(null, msgs);
case TacticdslPackage.RESOURCE_OPERATION__PARAMETERS:
return ((InternalEList>)getParameters()).basicRemove(otherEnd, msgs);
case TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER:
return basicSetDelegateHolder(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case TacticdslPackage.RESOURCE_OPERATION__DOC:
return getDoc();
case TacticdslPackage.RESOURCE_OPERATION__VISIBILITY:
return getVisibility();
case TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE:
return getReturnType();
case TacticdslPackage.RESOURCE_OPERATION__NAME:
return getName();
case TacticdslPackage.RESOURCE_OPERATION__PARAMETERS:
return getParameters();
case TacticdslPackage.RESOURCE_OPERATION__THROWS:
return getThrows();
case TacticdslPackage.RESOURCE_OPERATION__HINT:
return getHint();
case TacticdslPackage.RESOURCE_OPERATION__HTTP_METHOD:
return getHttpMethod();
case TacticdslPackage.RESOURCE_OPERATION__PATH:
return getPath();
case TacticdslPackage.RESOURCE_OPERATION__RETURN_STRING:
return getReturnString();
case TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER:
return getDelegateHolder();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case TacticdslPackage.RESOURCE_OPERATION__DOC:
setDoc((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__VISIBILITY:
setVisibility((Visibility)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE:
setReturnType((ComplexType)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__NAME:
setName((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__PARAMETERS:
getParameters().clear();
getParameters().addAll((Collection extends Parameter>)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__THROWS:
setThrows((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__HINT:
setHint((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__HTTP_METHOD:
setHttpMethod((HttpMethod)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__PATH:
setPath((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__RETURN_STRING:
setReturnString((String)newValue);
return;
case TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER:
setDelegateHolder((ResourceOperationDelegate)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case TacticdslPackage.RESOURCE_OPERATION__DOC:
setDoc(DOC_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__VISIBILITY:
setVisibility(VISIBILITY_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE:
setReturnType((ComplexType)null);
return;
case TacticdslPackage.RESOURCE_OPERATION__NAME:
setName(NAME_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__PARAMETERS:
getParameters().clear();
return;
case TacticdslPackage.RESOURCE_OPERATION__THROWS:
setThrows(THROWS_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__HINT:
setHint(HINT_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__HTTP_METHOD:
setHttpMethod(HTTP_METHOD_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__PATH:
setPath(PATH_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__RETURN_STRING:
setReturnString(RETURN_STRING_EDEFAULT);
return;
case TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER:
setDelegateHolder((ResourceOperationDelegate)null);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TacticdslPackage.RESOURCE_OPERATION__DOC:
return DOC_EDEFAULT == null ? doc != null : !DOC_EDEFAULT.equals(doc);
case TacticdslPackage.RESOURCE_OPERATION__VISIBILITY:
return visibility != VISIBILITY_EDEFAULT;
case TacticdslPackage.RESOURCE_OPERATION__RETURN_TYPE:
return returnType != null;
case TacticdslPackage.RESOURCE_OPERATION__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case TacticdslPackage.RESOURCE_OPERATION__PARAMETERS:
return parameters != null && !parameters.isEmpty();
case TacticdslPackage.RESOURCE_OPERATION__THROWS:
return THROWS_EDEFAULT == null ? throws_ != null : !THROWS_EDEFAULT.equals(throws_);
case TacticdslPackage.RESOURCE_OPERATION__HINT:
return HINT_EDEFAULT == null ? hint != null : !HINT_EDEFAULT.equals(hint);
case TacticdslPackage.RESOURCE_OPERATION__HTTP_METHOD:
return httpMethod != HTTP_METHOD_EDEFAULT;
case TacticdslPackage.RESOURCE_OPERATION__PATH:
return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path);
case TacticdslPackage.RESOURCE_OPERATION__RETURN_STRING:
return RETURN_STRING_EDEFAULT == null ? returnString != null : !RETURN_STRING_EDEFAULT.equals(returnString);
case TacticdslPackage.RESOURCE_OPERATION__DELEGATE_HOLDER:
return delegateHolder != null;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (doc: ");
result.append(doc);
result.append(", visibility: ");
result.append(visibility);
result.append(", name: ");
result.append(name);
result.append(", throws: ");
result.append(throws_);
result.append(", hint: ");
result.append(hint);
result.append(", httpMethod: ");
result.append(httpMethod);
result.append(", path: ");
result.append(path);
result.append(", returnString: ");
result.append(returnString);
result.append(')');
return result.toString();
}
} //ResourceOperationImpl