blob: d3afbaa7877d77f1b6eb8a06e26d0f14e12b4322 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2022 Christopher Gerking and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Christopher Gerking - initial API and implementation
*******************************************************************************/
package org.eclipse.m2m.tests.qvt.oml.bbox.bug577992.impl;
import java.lang.reflect.InvocationTargetException;
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.m2m.tests.qvt.oml.bbox.bug577992.Bug577992Package;
import org.eclipse.m2m.tests.qvt.oml.bbox.bug577992.TestClass;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Test Class</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.m2m.tests.qvt.oml.bbox.bug577992.impl.TestClassImpl#getAttr <em>Attr</em>}</li>
* </ul>
*
* @generated
*/
public class TestClassImpl extends MinimalEObjectImpl.Container implements TestClass {
/**
* The default value of the '{@link #getAttr() <em>Attr</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttr()
* @generated
* @ordered
*/
protected static final String ATTR_EDEFAULT = null;
/**
* The cached value of the '{@link #getAttr() <em>Attr</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAttr()
* @generated
* @ordered
*/
protected String attr = ATTR_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TestClassImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return Bug577992Package.Literals.TEST_CLASS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getAttr() {
return attr;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setAttr(String newAttr) {
String oldAttr = attr;
attr = newAttr;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, Bug577992Package.TEST_CLASS__ATTR, oldAttr, attr));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public TestClass op(TestClass par) {
// TODO: implement this method
// Ensure that you remove @generated or mark it @generated NOT
throw new UnsupportedOperationException();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case Bug577992Package.TEST_CLASS__ATTR:
return getAttr();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case Bug577992Package.TEST_CLASS__ATTR:
setAttr((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case Bug577992Package.TEST_CLASS__ATTR:
setAttr(ATTR_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case Bug577992Package.TEST_CLASS__ATTR:
return ATTR_EDEFAULT == null ? attr != null : !ATTR_EDEFAULT.equals(attr);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
switch (operationID) {
case Bug577992Package.TEST_CLASS___OP__TESTCLASS:
return op((TestClass)arguments.get(0));
}
return super.eInvoke(operationID, arguments);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (attr: ");
result.append(attr);
result.append(')');
return result.toString();
}
} //TestClassImpl