| /** |
| * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Lucas Koehler - initial API and implementation |
| */ |
| package org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| 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.emfforms.core.services.databinding.testmodel.test.model.C; |
| import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.F; |
| import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>F</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.FImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.FImpl#getC <em>C</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class FImpl extends MinimalEObjectImpl.Container implements F { |
| /** |
| * 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 cached value of the '{@link #getC() <em>C</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getC() |
| * @generated |
| * @ordered |
| */ |
| protected C c; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected FImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TestPackage.Literals.F; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getName() { |
| return name; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setName(String newName) { |
| final String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.F__NAME, oldName, name)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public C getC() { |
| if (c != null && c.eIsProxy()) { |
| final InternalEObject oldC = (InternalEObject) c; |
| c = (C) eResolveProxy(oldC); |
| if (c != oldC) { |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestPackage.F__C, oldC, c)); |
| } |
| } |
| } |
| return c; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public C basicGetC() { |
| return c; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setC(C newC) { |
| final C oldC = c; |
| c = newC; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.F__C, oldC, c)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TestPackage.F__NAME: |
| return getName(); |
| case TestPackage.F__C: |
| if (resolve) { |
| return getC(); |
| } |
| return basicGetC(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TestPackage.F__NAME: |
| setName((String) newValue); |
| return; |
| case TestPackage.F__C: |
| setC((C) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TestPackage.F__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case TestPackage.F__C: |
| setC((C) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TestPackage.F__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case TestPackage.F__C: |
| return c != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) { |
| return super.toString(); |
| } |
| |
| final StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (name: "); //$NON-NLS-1$ |
| result.append(name); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // FImpl |