org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl Maven / Gradle / Ivy
/**
* generated by Xtext 2.20.0
*/
package org.contextmapper.dsl.contextMappingDSL.impl;
import java.util.Collection;
import org.contextmapper.dsl.contextMappingDSL.Aggregate;
import org.contextmapper.dsl.contextMappingDSL.BoundedContext;
import org.contextmapper.dsl.contextMappingDSL.ContextMappingDSLPackage;
import org.contextmapper.dsl.contextMappingDSL.KnowledgeLevel;
import org.contextmapper.dsl.contextMappingDSL.LikelihoodForChange;
import org.contextmapper.dsl.contextMappingDSL.UserRequirement;
import org.contextmapper.tactic.dsl.tacticdsl.Consumer;
import org.contextmapper.tactic.dsl.tacticdsl.Resource;
import org.contextmapper.tactic.dsl.tacticdsl.Service;
import org.contextmapper.tactic.dsl.tacticdsl.SimpleDomainObject;
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.EDataTypeEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
*
* An implementation of the model object 'Aggregate'.
*
*
* The following features are implemented:
*
*
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getComment Comment}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getDoc Doc}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getName Name}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getResponsibilities Responsibilities}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getUserRequirements User Requirements}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getOwner Owner}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getKnowledgeLevel Knowledge Level}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getLikelihoodForChange Likelihood For Change}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getServices Services}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getResources Resources}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getConsumers Consumers}
* - {@link org.contextmapper.dsl.contextMappingDSL.impl.AggregateImpl#getDomainObjects Domain Objects}
*
*
* @generated
*/
public class AggregateImpl extends MinimalEObjectImpl.Container implements Aggregate
{
/**
* The default value of the '{@link #getComment() Comment}' attribute.
*
*
* @see #getComment()
* @generated
* @ordered
*/
protected static final String COMMENT_EDEFAULT = null;
/**
* The cached value of the '{@link #getComment() Comment}' attribute.
*
*
* @see #getComment()
* @generated
* @ordered
*/
protected String comment = COMMENT_EDEFAULT;
/**
* 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 #getResponsibilities() Responsibilities}' attribute list.
*
*
* @see #getResponsibilities()
* @generated
* @ordered
*/
protected EList responsibilities;
/**
* The cached value of the '{@link #getUserRequirements() User Requirements}' reference list.
*
*
* @see #getUserRequirements()
* @generated
* @ordered
*/
protected EList userRequirements;
/**
* The cached value of the '{@link #getOwner() Owner}' reference.
*
*
* @see #getOwner()
* @generated
* @ordered
*/
protected BoundedContext owner;
/**
* The default value of the '{@link #getKnowledgeLevel() Knowledge Level}' attribute.
*
*
* @see #getKnowledgeLevel()
* @generated
* @ordered
*/
protected static final KnowledgeLevel KNOWLEDGE_LEVEL_EDEFAULT = KnowledgeLevel.META;
/**
* The cached value of the '{@link #getKnowledgeLevel() Knowledge Level}' attribute.
*
*
* @see #getKnowledgeLevel()
* @generated
* @ordered
*/
protected KnowledgeLevel knowledgeLevel = KNOWLEDGE_LEVEL_EDEFAULT;
/**
* The default value of the '{@link #getLikelihoodForChange() Likelihood For Change}' attribute.
*
*
* @see #getLikelihoodForChange()
* @generated
* @ordered
*/
protected static final LikelihoodForChange LIKELIHOOD_FOR_CHANGE_EDEFAULT = LikelihoodForChange.NORMAL;
/**
* The cached value of the '{@link #getLikelihoodForChange() Likelihood For Change}' attribute.
*
*
* @see #getLikelihoodForChange()
* @generated
* @ordered
*/
protected LikelihoodForChange likelihoodForChange = LIKELIHOOD_FOR_CHANGE_EDEFAULT;
/**
* The cached value of the '{@link #getServices() Services}' containment reference list.
*
*
* @see #getServices()
* @generated
* @ordered
*/
protected EList services;
/**
* The cached value of the '{@link #getResources() Resources}' containment reference list.
*
*
* @see #getResources()
* @generated
* @ordered
*/
protected EList resources;
/**
* The cached value of the '{@link #getConsumers() Consumers}' containment reference list.
*
*
* @see #getConsumers()
* @generated
* @ordered
*/
protected EList consumers;
/**
* The cached value of the '{@link #getDomainObjects() Domain Objects}' containment reference list.
*
*
* @see #getDomainObjects()
* @generated
* @ordered
*/
protected EList domainObjects;
/**
*
*
* @generated
*/
protected AggregateImpl()
{
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ContextMappingDSLPackage.Literals.AGGREGATE;
}
/**
*
*
* @generated
*/
public String getComment()
{
return comment;
}
/**
*
*
* @generated
*/
public void setComment(String newComment)
{
String oldComment = comment;
comment = newComment;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextMappingDSLPackage.AGGREGATE__COMMENT, oldComment, comment));
}
/**
*
*
* @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, ContextMappingDSLPackage.AGGREGATE__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, ContextMappingDSLPackage.AGGREGATE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public EList getResponsibilities()
{
if (responsibilities == null)
{
responsibilities = new EDataTypeEList(String.class, this, ContextMappingDSLPackage.AGGREGATE__RESPONSIBILITIES);
}
return responsibilities;
}
/**
*
*
* @generated
*/
public EList getUserRequirements()
{
if (userRequirements == null)
{
userRequirements = new EObjectResolvingEList(UserRequirement.class, this, ContextMappingDSLPackage.AGGREGATE__USER_REQUIREMENTS);
}
return userRequirements;
}
/**
*
*
* @generated
*/
public BoundedContext getOwner()
{
if (owner != null && owner.eIsProxy())
{
InternalEObject oldOwner = (InternalEObject)owner;
owner = (BoundedContext)eResolveProxy(oldOwner);
if (owner != oldOwner)
{
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ContextMappingDSLPackage.AGGREGATE__OWNER, oldOwner, owner));
}
}
return owner;
}
/**
*
*
* @generated
*/
public BoundedContext basicGetOwner()
{
return owner;
}
/**
*
*
* @generated
*/
public void setOwner(BoundedContext newOwner)
{
BoundedContext oldOwner = owner;
owner = newOwner;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextMappingDSLPackage.AGGREGATE__OWNER, oldOwner, owner));
}
/**
*
*
* @generated
*/
public KnowledgeLevel getKnowledgeLevel()
{
return knowledgeLevel;
}
/**
*
*
* @generated
*/
public void setKnowledgeLevel(KnowledgeLevel newKnowledgeLevel)
{
KnowledgeLevel oldKnowledgeLevel = knowledgeLevel;
knowledgeLevel = newKnowledgeLevel == null ? KNOWLEDGE_LEVEL_EDEFAULT : newKnowledgeLevel;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextMappingDSLPackage.AGGREGATE__KNOWLEDGE_LEVEL, oldKnowledgeLevel, knowledgeLevel));
}
/**
*
*
* @generated
*/
public LikelihoodForChange getLikelihoodForChange()
{
return likelihoodForChange;
}
/**
*
*
* @generated
*/
public void setLikelihoodForChange(LikelihoodForChange newLikelihoodForChange)
{
LikelihoodForChange oldLikelihoodForChange = likelihoodForChange;
likelihoodForChange = newLikelihoodForChange == null ? LIKELIHOOD_FOR_CHANGE_EDEFAULT : newLikelihoodForChange;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ContextMappingDSLPackage.AGGREGATE__LIKELIHOOD_FOR_CHANGE, oldLikelihoodForChange, likelihoodForChange));
}
/**
*
*
* @generated
*/
public EList getServices()
{
if (services == null)
{
services = new EObjectContainmentEList(Service.class, this, ContextMappingDSLPackage.AGGREGATE__SERVICES);
}
return services;
}
/**
*
*
* @generated
*/
public EList getResources()
{
if (resources == null)
{
resources = new EObjectContainmentEList(Resource.class, this, ContextMappingDSLPackage.AGGREGATE__RESOURCES);
}
return resources;
}
/**
*
*
* @generated
*/
public EList getConsumers()
{
if (consumers == null)
{
consumers = new EObjectContainmentEList(Consumer.class, this, ContextMappingDSLPackage.AGGREGATE__CONSUMERS);
}
return consumers;
}
/**
*
*
* @generated
*/
public EList getDomainObjects()
{
if (domainObjects == null)
{
domainObjects = new EObjectContainmentEList(SimpleDomainObject.class, this, ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS);
}
return domainObjects;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case ContextMappingDSLPackage.AGGREGATE__SERVICES:
return ((InternalEList>)getServices()).basicRemove(otherEnd, msgs);
case ContextMappingDSLPackage.AGGREGATE__RESOURCES:
return ((InternalEList>)getResources()).basicRemove(otherEnd, msgs);
case ContextMappingDSLPackage.AGGREGATE__CONSUMERS:
return ((InternalEList>)getConsumers()).basicRemove(otherEnd, msgs);
case ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS:
return ((InternalEList>)getDomainObjects()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case ContextMappingDSLPackage.AGGREGATE__COMMENT:
return getComment();
case ContextMappingDSLPackage.AGGREGATE__DOC:
return getDoc();
case ContextMappingDSLPackage.AGGREGATE__NAME:
return getName();
case ContextMappingDSLPackage.AGGREGATE__RESPONSIBILITIES:
return getResponsibilities();
case ContextMappingDSLPackage.AGGREGATE__USER_REQUIREMENTS:
return getUserRequirements();
case ContextMappingDSLPackage.AGGREGATE__OWNER:
if (resolve) return getOwner();
return basicGetOwner();
case ContextMappingDSLPackage.AGGREGATE__KNOWLEDGE_LEVEL:
return getKnowledgeLevel();
case ContextMappingDSLPackage.AGGREGATE__LIKELIHOOD_FOR_CHANGE:
return getLikelihoodForChange();
case ContextMappingDSLPackage.AGGREGATE__SERVICES:
return getServices();
case ContextMappingDSLPackage.AGGREGATE__RESOURCES:
return getResources();
case ContextMappingDSLPackage.AGGREGATE__CONSUMERS:
return getConsumers();
case ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS:
return getDomainObjects();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case ContextMappingDSLPackage.AGGREGATE__COMMENT:
setComment((String)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__DOC:
setDoc((String)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__NAME:
setName((String)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__RESPONSIBILITIES:
getResponsibilities().clear();
getResponsibilities().addAll((Collection extends String>)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__USER_REQUIREMENTS:
getUserRequirements().clear();
getUserRequirements().addAll((Collection extends UserRequirement>)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__OWNER:
setOwner((BoundedContext)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__KNOWLEDGE_LEVEL:
setKnowledgeLevel((KnowledgeLevel)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__LIKELIHOOD_FOR_CHANGE:
setLikelihoodForChange((LikelihoodForChange)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__SERVICES:
getServices().clear();
getServices().addAll((Collection extends Service>)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__RESOURCES:
getResources().clear();
getResources().addAll((Collection extends Resource>)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__CONSUMERS:
getConsumers().clear();
getConsumers().addAll((Collection extends Consumer>)newValue);
return;
case ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS:
getDomainObjects().clear();
getDomainObjects().addAll((Collection extends SimpleDomainObject>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case ContextMappingDSLPackage.AGGREGATE__COMMENT:
setComment(COMMENT_EDEFAULT);
return;
case ContextMappingDSLPackage.AGGREGATE__DOC:
setDoc(DOC_EDEFAULT);
return;
case ContextMappingDSLPackage.AGGREGATE__NAME:
setName(NAME_EDEFAULT);
return;
case ContextMappingDSLPackage.AGGREGATE__RESPONSIBILITIES:
getResponsibilities().clear();
return;
case ContextMappingDSLPackage.AGGREGATE__USER_REQUIREMENTS:
getUserRequirements().clear();
return;
case ContextMappingDSLPackage.AGGREGATE__OWNER:
setOwner((BoundedContext)null);
return;
case ContextMappingDSLPackage.AGGREGATE__KNOWLEDGE_LEVEL:
setKnowledgeLevel(KNOWLEDGE_LEVEL_EDEFAULT);
return;
case ContextMappingDSLPackage.AGGREGATE__LIKELIHOOD_FOR_CHANGE:
setLikelihoodForChange(LIKELIHOOD_FOR_CHANGE_EDEFAULT);
return;
case ContextMappingDSLPackage.AGGREGATE__SERVICES:
getServices().clear();
return;
case ContextMappingDSLPackage.AGGREGATE__RESOURCES:
getResources().clear();
return;
case ContextMappingDSLPackage.AGGREGATE__CONSUMERS:
getConsumers().clear();
return;
case ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS:
getDomainObjects().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case ContextMappingDSLPackage.AGGREGATE__COMMENT:
return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment);
case ContextMappingDSLPackage.AGGREGATE__DOC:
return DOC_EDEFAULT == null ? doc != null : !DOC_EDEFAULT.equals(doc);
case ContextMappingDSLPackage.AGGREGATE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case ContextMappingDSLPackage.AGGREGATE__RESPONSIBILITIES:
return responsibilities != null && !responsibilities.isEmpty();
case ContextMappingDSLPackage.AGGREGATE__USER_REQUIREMENTS:
return userRequirements != null && !userRequirements.isEmpty();
case ContextMappingDSLPackage.AGGREGATE__OWNER:
return owner != null;
case ContextMappingDSLPackage.AGGREGATE__KNOWLEDGE_LEVEL:
return knowledgeLevel != KNOWLEDGE_LEVEL_EDEFAULT;
case ContextMappingDSLPackage.AGGREGATE__LIKELIHOOD_FOR_CHANGE:
return likelihoodForChange != LIKELIHOOD_FOR_CHANGE_EDEFAULT;
case ContextMappingDSLPackage.AGGREGATE__SERVICES:
return services != null && !services.isEmpty();
case ContextMappingDSLPackage.AGGREGATE__RESOURCES:
return resources != null && !resources.isEmpty();
case ContextMappingDSLPackage.AGGREGATE__CONSUMERS:
return consumers != null && !consumers.isEmpty();
case ContextMappingDSLPackage.AGGREGATE__DOMAIN_OBJECTS:
return domainObjects != null && !domainObjects.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString()
{
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (comment: ");
result.append(comment);
result.append(", doc: ");
result.append(doc);
result.append(", name: ");
result.append(name);
result.append(", responsibilities: ");
result.append(responsibilities);
result.append(", knowledgeLevel: ");
result.append(knowledgeLevel);
result.append(", likelihoodForChange: ");
result.append(likelihoodForChange);
result.append(')');
return result.toString();
}
} //AggregateImpl