blob: 3adae7153eae7ad3383269e3dc874426f5a8be90 [file] [log] [blame]
/**
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation
*
*/
package org.eclipse.osbp.xtext.entitymock.impl;
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;
import org.eclipse.osbp.xtext.entitymock.EntityMock;
import org.eclipse.osbp.xtext.entitymock.EntityMockDSLPackage;
import org.eclipse.osbp.xtext.entitymock.EntityMockEntities;
import org.eclipse.osbp.xtext.entitymock.EntityMockObjects;
import org.eclipse.osbp.xtext.entitymock.EntityMockResources;
import org.eclipse.osbp.xtext.entitymock.RunningDataInterchanges;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Entity Mock</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#isDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getDescriptionValue <em>Description Value</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getRunPriority <em>Run Priority</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getDatainterchanges <em>Datainterchanges</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getResources <em>Resources</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getObjects <em>Objects</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockImpl#getEntities <em>Entities</em>}</li>
* </ul>
*
* @generated
*/
public class EntityMockImpl extends MinimalEObjectImpl.Container implements EntityMock {
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #isDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDescription()
* @generated
* @ordered
*/
protected static final boolean DESCRIPTION_EDEFAULT = false;
/**
* The cached value of the '{@link #isDescription() <em>Description</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isDescription()
* @generated
* @ordered
*/
protected boolean description = DESCRIPTION_EDEFAULT;
/**
* The default value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescriptionValue()
* @generated
* @ordered
*/
protected static final String DESCRIPTION_VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDescriptionValue()
* @generated
* @ordered
*/
protected String descriptionValue = DESCRIPTION_VALUE_EDEFAULT;
/**
* The default value of the '{@link #getRunPriority() <em>Run Priority</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRunPriority()
* @generated
* @ordered
*/
protected static final int RUN_PRIORITY_EDEFAULT = 0;
/**
* The cached value of the '{@link #getRunPriority() <em>Run Priority</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRunPriority()
* @generated
* @ordered
*/
protected int runPriority = RUN_PRIORITY_EDEFAULT;
/**
* The cached value of the '{@link #getDatainterchanges() <em>Datainterchanges</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDatainterchanges()
* @generated
* @ordered
*/
protected RunningDataInterchanges datainterchanges;
/**
* The cached value of the '{@link #getResources() <em>Resources</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getResources()
* @generated
* @ordered
*/
protected EntityMockResources resources;
/**
* The cached value of the '{@link #getObjects() <em>Objects</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getObjects()
* @generated
* @ordered
*/
protected EntityMockObjects objects;
/**
* The cached value of the '{@link #getEntities() <em>Entities</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntities()
* @generated
* @ordered
*/
protected EntityMockEntities entities;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EntityMockImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EntityMockDSLPackage.Literals.ENTITY_MOCK;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isDescription() {
return description;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescription(boolean newDescription) {
boolean oldDescription = description;
description = newDescription;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION, oldDescription, description));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDescriptionValue() {
return descriptionValue;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDescriptionValue(String newDescriptionValue) {
String oldDescriptionValue = descriptionValue;
descriptionValue = newDescriptionValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION_VALUE, oldDescriptionValue, descriptionValue));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getRunPriority() {
return runPriority;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRunPriority(int newRunPriority) {
int oldRunPriority = runPriority;
runPriority = newRunPriority;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__RUN_PRIORITY, oldRunPriority, runPriority));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public RunningDataInterchanges getDatainterchanges() {
return datainterchanges;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetDatainterchanges(RunningDataInterchanges newDatainterchanges, NotificationChain msgs) {
RunningDataInterchanges oldDatainterchanges = datainterchanges;
datainterchanges = newDatainterchanges;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES, oldDatainterchanges, newDatainterchanges);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDatainterchanges(RunningDataInterchanges newDatainterchanges) {
if (newDatainterchanges != datainterchanges) {
NotificationChain msgs = null;
if (datainterchanges != null)
msgs = ((InternalEObject)datainterchanges).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES, null, msgs);
if (newDatainterchanges != null)
msgs = ((InternalEObject)newDatainterchanges).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES, null, msgs);
msgs = basicSetDatainterchanges(newDatainterchanges, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES, newDatainterchanges, newDatainterchanges));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EntityMockResources getResources() {
return resources;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetResources(EntityMockResources newResources, NotificationChain msgs) {
EntityMockResources oldResources = resources;
resources = newResources;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__RESOURCES, oldResources, newResources);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setResources(EntityMockResources newResources) {
if (newResources != resources) {
NotificationChain msgs = null;
if (resources != null)
msgs = ((InternalEObject)resources).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__RESOURCES, null, msgs);
if (newResources != null)
msgs = ((InternalEObject)newResources).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__RESOURCES, null, msgs);
msgs = basicSetResources(newResources, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__RESOURCES, newResources, newResources));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EntityMockObjects getObjects() {
return objects;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetObjects(EntityMockObjects newObjects, NotificationChain msgs) {
EntityMockObjects oldObjects = objects;
objects = newObjects;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__OBJECTS, oldObjects, newObjects);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setObjects(EntityMockObjects newObjects) {
if (newObjects != objects) {
NotificationChain msgs = null;
if (objects != null)
msgs = ((InternalEObject)objects).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__OBJECTS, null, msgs);
if (newObjects != null)
msgs = ((InternalEObject)newObjects).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__OBJECTS, null, msgs);
msgs = basicSetObjects(newObjects, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__OBJECTS, newObjects, newObjects));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EntityMockEntities getEntities() {
return entities;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetEntities(EntityMockEntities newEntities, NotificationChain msgs) {
EntityMockEntities oldEntities = entities;
entities = newEntities;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__ENTITIES, oldEntities, newEntities);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEntities(EntityMockEntities newEntities) {
if (newEntities != entities) {
NotificationChain msgs = null;
if (entities != null)
msgs = ((InternalEObject)entities).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__ENTITIES, null, msgs);
if (newEntities != null)
msgs = ((InternalEObject)newEntities).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK__ENTITIES, null, msgs);
msgs = basicSetEntities(newEntities, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK__ENTITIES, newEntities, newEntities));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES:
return basicSetDatainterchanges(null, msgs);
case EntityMockDSLPackage.ENTITY_MOCK__RESOURCES:
return basicSetResources(null, msgs);
case EntityMockDSLPackage.ENTITY_MOCK__OBJECTS:
return basicSetObjects(null, msgs);
case EntityMockDSLPackage.ENTITY_MOCK__ENTITIES:
return basicSetEntities(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 EntityMockDSLPackage.ENTITY_MOCK__NAME:
return getName();
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION:
return isDescription();
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION_VALUE:
return getDescriptionValue();
case EntityMockDSLPackage.ENTITY_MOCK__RUN_PRIORITY:
return getRunPriority();
case EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES:
return getDatainterchanges();
case EntityMockDSLPackage.ENTITY_MOCK__RESOURCES:
return getResources();
case EntityMockDSLPackage.ENTITY_MOCK__OBJECTS:
return getObjects();
case EntityMockDSLPackage.ENTITY_MOCK__ENTITIES:
return getEntities();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK__NAME:
setName((String)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION:
setDescription((Boolean)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION_VALUE:
setDescriptionValue((String)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__RUN_PRIORITY:
setRunPriority((Integer)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES:
setDatainterchanges((RunningDataInterchanges)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__RESOURCES:
setResources((EntityMockResources)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__OBJECTS:
setObjects((EntityMockObjects)newValue);
return;
case EntityMockDSLPackage.ENTITY_MOCK__ENTITIES:
setEntities((EntityMockEntities)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK__NAME:
setName(NAME_EDEFAULT);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION_VALUE:
setDescriptionValue(DESCRIPTION_VALUE_EDEFAULT);
return;
case EntityMockDSLPackage.ENTITY_MOCK__RUN_PRIORITY:
setRunPriority(RUN_PRIORITY_EDEFAULT);
return;
case EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES:
setDatainterchanges((RunningDataInterchanges)null);
return;
case EntityMockDSLPackage.ENTITY_MOCK__RESOURCES:
setResources((EntityMockResources)null);
return;
case EntityMockDSLPackage.ENTITY_MOCK__OBJECTS:
setObjects((EntityMockObjects)null);
return;
case EntityMockDSLPackage.ENTITY_MOCK__ENTITIES:
setEntities((EntityMockEntities)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION:
return description != DESCRIPTION_EDEFAULT;
case EntityMockDSLPackage.ENTITY_MOCK__DESCRIPTION_VALUE:
return DESCRIPTION_VALUE_EDEFAULT == null ? descriptionValue != null : !DESCRIPTION_VALUE_EDEFAULT.equals(descriptionValue);
case EntityMockDSLPackage.ENTITY_MOCK__RUN_PRIORITY:
return runPriority != RUN_PRIORITY_EDEFAULT;
case EntityMockDSLPackage.ENTITY_MOCK__DATAINTERCHANGES:
return datainterchanges != null;
case EntityMockDSLPackage.ENTITY_MOCK__RESOURCES:
return resources != null;
case EntityMockDSLPackage.ENTITY_MOCK__OBJECTS:
return objects != null;
case EntityMockDSLPackage.ENTITY_MOCK__ENTITIES:
return entities != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (name: ");
result.append(name);
result.append(", description: ");
result.append(description);
result.append(", descriptionValue: ");
result.append(descriptionValue);
result.append(", runPriority: ");
result.append(runPriority);
result.append(')');
return result.toString();
}
} //EntityMockImpl