| /** |
| * Copyright (c) 2011-2015 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 java.util.Collection; |
| |
| 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.emf.ecore.util.EDataTypeUniqueEList; |
| import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.D; |
| import org.eclipse.emfforms.core.services.databinding.testmodel.test.model.TestPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>D</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.DImpl#getX <em>X</em>}</li> |
| * <li>{@link org.eclipse.emfforms.core.services.databinding.testmodel.test.model.impl.DImpl#getYList |
| * <em>YList</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DImpl extends MinimalEObjectImpl.Container implements D { |
| /** |
| * The default value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected static final String X_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getX() <em>X</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getX() |
| * @generated |
| * @ordered |
| */ |
| protected String x = X_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getYList() <em>YList</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getYList() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Integer> yList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected DImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return TestPackage.Literals.D; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getX() { |
| return x; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setX(String newX) { |
| final String oldX = x; |
| x = newX; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.D__X, oldX, x)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public EList<Integer> getYList() { |
| if (yList == null) { |
| yList = new EDataTypeUniqueEList<>(Integer.class, this, TestPackage.D__YLIST); |
| } |
| return yList; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case TestPackage.D__X: |
| return getX(); |
| case TestPackage.D__YLIST: |
| return getYList(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case TestPackage.D__X: |
| setX((String) newValue); |
| return; |
| case TestPackage.D__YLIST: |
| getYList().clear(); |
| getYList().addAll((Collection<? extends Integer>) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case TestPackage.D__X: |
| setX(X_EDEFAULT); |
| return; |
| case TestPackage.D__YLIST: |
| getYList().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case TestPackage.D__X: |
| return X_EDEFAULT == null ? x != null : !X_EDEFAULT.equals(x); |
| case TestPackage.D__YLIST: |
| return yList != null && !yList.isEmpty(); |
| } |
| 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(" (x: "); //$NON-NLS-1$ |
| result.append(x); |
| result.append(", yList: "); //$NON-NLS-1$ |
| result.append(yList); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // DImpl |