| /** |
| * Copyright (c) 2013, 2017 CEA LIST. |
| * |
| * 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.cdo.internal.core.repositories.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.papyrus.cdo.internal.core.repositories.RepositoriesPackage; |
| import org.eclipse.papyrus.cdo.internal.core.repositories.Repository; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Repository</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.cdo.internal.core.repositories.impl.RepositoryImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.papyrus.cdo.internal.core.repositories.impl.RepositoryImpl#getURL <em>URL</em>}</li> |
| * <li>{@link org.eclipse.papyrus.cdo.internal.core.repositories.impl.RepositoryImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.papyrus.cdo.internal.core.repositories.impl.RepositoryImpl#getUUID <em>UUID</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class RepositoryImpl extends MinimalEObjectImpl.Container implements Repository { |
| /** |
| * 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 default value of the '{@link #getURL() <em>URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getURL() |
| * @generated |
| * @ordered |
| */ |
| protected static final String URL_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getURL() <em>URL</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getURL() |
| * @generated |
| * @ordered |
| */ |
| protected String uRL = URL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected String description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getUUID() <em>UUID</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getUUID() |
| * @generated |
| * @ordered |
| */ |
| protected static final String UUID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getUUID() <em>UUID</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getUUID() |
| * @generated |
| * @ordered |
| */ |
| protected String uUID = UUID_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected RepositoryImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return RepositoriesPackage.Literals.REPOSITORY; |
| } |
| |
| /** |
| * <!-- 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) { |
| String oldName = name; |
| name = newName; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, RepositoriesPackage.REPOSITORY__NAME, oldName, name)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getURL() { |
| return uRL; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setURL(String newURL) { |
| String oldURL = uRL; |
| uRL = newURL; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, RepositoriesPackage.REPOSITORY__URL, oldURL, uRL)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setDescription(String newDescription) { |
| String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, RepositoriesPackage.REPOSITORY__DESCRIPTION, oldDescription, description)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String getUUID() { |
| return uUID; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setUUID(String newUUID) { |
| String oldUUID = uUID; |
| uUID = newUUID; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, RepositoriesPackage.REPOSITORY__UUID, oldUUID, uUID)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case RepositoriesPackage.REPOSITORY__NAME: |
| return getName(); |
| case RepositoriesPackage.REPOSITORY__URL: |
| return getURL(); |
| case RepositoriesPackage.REPOSITORY__DESCRIPTION: |
| return getDescription(); |
| case RepositoriesPackage.REPOSITORY__UUID: |
| return getUUID(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case RepositoriesPackage.REPOSITORY__NAME: |
| setName((String) newValue); |
| return; |
| case RepositoriesPackage.REPOSITORY__URL: |
| setURL((String) newValue); |
| return; |
| case RepositoriesPackage.REPOSITORY__DESCRIPTION: |
| setDescription((String) newValue); |
| return; |
| case RepositoriesPackage.REPOSITORY__UUID: |
| setUUID((String) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case RepositoriesPackage.REPOSITORY__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case RepositoriesPackage.REPOSITORY__URL: |
| setURL(URL_EDEFAULT); |
| return; |
| case RepositoriesPackage.REPOSITORY__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case RepositoriesPackage.REPOSITORY__UUID: |
| setUUID(UUID_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case RepositoriesPackage.REPOSITORY__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case RepositoriesPackage.REPOSITORY__URL: |
| return URL_EDEFAULT == null ? uRL != null : !URL_EDEFAULT.equals(uRL); |
| case RepositoriesPackage.REPOSITORY__DESCRIPTION: |
| return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); |
| case RepositoriesPackage.REPOSITORY__UUID: |
| return UUID_EDEFAULT == null ? uUID != null : !UUID_EDEFAULT.equals(uUID); |
| } |
| 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(" (name: "); //$NON-NLS-1$ |
| result.append(name); |
| result.append(", uRL: "); //$NON-NLS-1$ |
| result.append(uRL); |
| result.append(", description: "); //$NON-NLS-1$ |
| result.append(description); |
| result.append(", uUID: "); //$NON-NLS-1$ |
| result.append(uUID); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // RepositoryImpl |