blob: 3f45cb1a25629e2dd143a80b25909a86b6759bca [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.osbp.xtext.entitymock.EntityMockDSLPackage;
import org.eclipse.osbp.xtext.entitymock.EntityMockObjectFill;
import org.eclipse.osbp.xtext.entitymock.PropertyFillerType;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Entity Mock Object Fill</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.entitymock.impl.EntityMockObjectFillImpl#getFillerType <em>Filler Type</em>}</li>
* </ul>
*
* @generated
*/
public class EntityMockObjectFillImpl extends IEntityMockObjectAttributeImpl implements EntityMockObjectFill {
/**
* The cached value of the '{@link #getFillerType() <em>Filler Type</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFillerType()
* @generated
* @ordered
*/
protected PropertyFillerType fillerType;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EntityMockObjectFillImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EntityMockDSLPackage.Literals.ENTITY_MOCK_OBJECT_FILL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public PropertyFillerType getFillerType() {
return fillerType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetFillerType(PropertyFillerType newFillerType, NotificationChain msgs) {
PropertyFillerType oldFillerType = fillerType;
fillerType = newFillerType;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE, oldFillerType, newFillerType);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFillerType(PropertyFillerType newFillerType) {
if (newFillerType != fillerType) {
NotificationChain msgs = null;
if (fillerType != null)
msgs = ((InternalEObject)fillerType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE, null, msgs);
if (newFillerType != null)
msgs = ((InternalEObject)newFillerType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE, null, msgs);
msgs = basicSetFillerType(newFillerType, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE, newFillerType, newFillerType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE:
return basicSetFillerType(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_OBJECT_FILL__FILLER_TYPE:
return getFillerType();
}
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_OBJECT_FILL__FILLER_TYPE:
setFillerType((PropertyFillerType)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_OBJECT_FILL__FILLER_TYPE:
setFillerType((PropertyFillerType)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EntityMockDSLPackage.ENTITY_MOCK_OBJECT_FILL__FILLER_TYPE:
return fillerType != null;
}
return super.eIsSet(featureID);
}
} //EntityMockObjectFillImpl