org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl.RelatedGroupImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.20.0
*/
package org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl;
import java.util.Collection;
import org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.RelatedGroup;
import org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.ServiceCutterConfigurationDSLPackage;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeEList;
/**
*
* An implementation of the model object 'Related Group'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl.RelatedGroupImpl#getDoc Doc}
* - {@link org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl.RelatedGroupImpl#getName Name}
* - {@link org.contextmapper.servicecutter.dsl.serviceCutterConfigurationDSL.impl.RelatedGroupImpl#getNanoentities Nanoentities}
*
*
* @generated
*/
public class RelatedGroupImpl extends MinimalEObjectImpl.Container implements RelatedGroup
{
/**
* 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 #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 #getNanoentities() Nanoentities}' attribute list.
*
*
* @see #getNanoentities()
* @generated
* @ordered
*/
protected EList nanoentities;
/**
*
*
* @generated
*/
protected RelatedGroupImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ServiceCutterConfigurationDSLPackage.Literals.RELATED_GROUP;
}
/**
*
*
* @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, ServiceCutterConfigurationDSLPackage.RELATED_GROUP__DOC, oldDoc, doc));
}
/**
*
*
* @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, ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public EList getNanoentities()
{
if (nanoentities == null)
{
nanoentities = new EDataTypeEList(String.class, this, ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NANOENTITIES);
}
return nanoentities;
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__DOC:
return getDoc();
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NAME:
return getName();
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NANOENTITIES:
return getNanoentities();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__DOC:
setDoc((String)newValue);
return;
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NAME:
setName((String)newValue);
return;
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NANOENTITIES:
getNanoentities().clear();
getNanoentities().addAll((Collection extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__DOC:
setDoc(DOC_EDEFAULT);
return;
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NAME:
setName(NAME_EDEFAULT);
return;
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NANOENTITIES:
getNanoentities().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__DOC:
return DOC_EDEFAULT == null ? doc != null : !DOC_EDEFAULT.equals(doc);
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case ServiceCutterConfigurationDSLPackage.RELATED_GROUP__NANOENTITIES:
return nanoentities != null && !nanoentities.isEmpty();
}
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(", name: ");
result.append(name);
result.append(", nanoentities: ");
result.append(nanoentities);
result.append(')');
return result.toString();
}
} //RelatedGroupImpl