| /** |
| * Copyright (c) 2016 CEA LIST and others. |
| * |
| * 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 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| * |
| */ |
| package org.eclipse.papyrus.interoperability.rpy.rpymetamodel.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.EDataTypeEList; |
| |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.UMLRpyPackage; |
| import org.eclipse.papyrus.interoperability.rpy.rpymetamodel.ValueType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Value Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.ValueTypeImpl#getModifiedTimeWeak <em>Modified Time Weak</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.ValueTypeImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.ValueTypeImpl#getMyState <em>My State</em>}</li> |
| * <li>{@link org.eclipse.papyrus.interoperability.rpy.rpymetamodel.impl.ValueTypeImpl#getName <em>Name</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class ValueTypeImpl extends MinimalEObjectImpl.Container implements ValueType { |
| /** |
| * The cached value of the '{@link #getModifiedTimeWeak() <em>Modified Time Weak</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getModifiedTimeWeak() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> modifiedTimeWeak; |
| |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMyState() <em>My State</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMyState() |
| * @generated |
| * @ordered |
| */ |
| protected static final String MY_STATE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getMyState() <em>My State</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMyState() |
| * @generated |
| * @ordered |
| */ |
| protected String myState = MY_STATE_EDEFAULT; |
| |
| /** |
| * 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; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ValueTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UMLRpyPackage.eINSTANCE.getValueType(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getModifiedTimeWeak() { |
| if (modifiedTimeWeak == null) { |
| modifiedTimeWeak = new EDataTypeEList<String>(String.class, this, UMLRpyPackage.VALUE_TYPE__MODIFIED_TIME_WEAK); |
| } |
| return modifiedTimeWeak; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.VALUE_TYPE__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getMyState() { |
| return myState; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMyState(String newMyState) { |
| String oldMyState = myState; |
| myState = newMyState; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UMLRpyPackage.VALUE_TYPE__MY_STATE, oldMyState, myState)); |
| } |
| |
| /** |
| * <!-- 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, UMLRpyPackage.VALUE_TYPE__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UMLRpyPackage.VALUE_TYPE__MODIFIED_TIME_WEAK: |
| return getModifiedTimeWeak(); |
| case UMLRpyPackage.VALUE_TYPE__ID: |
| return getId(); |
| case UMLRpyPackage.VALUE_TYPE__MY_STATE: |
| return getMyState(); |
| case UMLRpyPackage.VALUE_TYPE__NAME: |
| return getName(); |
| } |
| 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 UMLRpyPackage.VALUE_TYPE__MODIFIED_TIME_WEAK: |
| getModifiedTimeWeak().clear(); |
| getModifiedTimeWeak().addAll((Collection<? extends String>)newValue); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__ID: |
| setId((String)newValue); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__MY_STATE: |
| setMyState((String)newValue); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__NAME: |
| setName((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UMLRpyPackage.VALUE_TYPE__MODIFIED_TIME_WEAK: |
| getModifiedTimeWeak().clear(); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__MY_STATE: |
| setMyState(MY_STATE_EDEFAULT); |
| return; |
| case UMLRpyPackage.VALUE_TYPE__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UMLRpyPackage.VALUE_TYPE__MODIFIED_TIME_WEAK: |
| return modifiedTimeWeak != null && !modifiedTimeWeak.isEmpty(); |
| case UMLRpyPackage.VALUE_TYPE__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case UMLRpyPackage.VALUE_TYPE__MY_STATE: |
| return MY_STATE_EDEFAULT == null ? myState != null : !MY_STATE_EDEFAULT.equals(myState); |
| case UMLRpyPackage.VALUE_TYPE__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| } |
| 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(" (modifiedTimeWeak: "); //$NON-NLS-1$ |
| result.append(modifiedTimeWeak); |
| result.append(", id: "); //$NON-NLS-1$ |
| result.append(id); |
| result.append(", myState: "); //$NON-NLS-1$ |
| result.append(myState); |
| result.append(", name: "); //$NON-NLS-1$ |
| result.append(name); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ValueTypeImpl |