blob: 6f0109813a16b74cdd0b88855cde434f65540837 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008-2011 Chair for Applied Software Engineering,
* Technische Universitaet Muenchen.
* 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:
******************************************************************************/
package org.eclipse.emf.emfstore.internal.server.model.versioning.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.EObjectImpl;
import org.eclipse.emf.emfstore.internal.server.model.versioning.VersionSpec;
import org.eclipse.emf.emfstore.internal.server.model.versioning.VersioningPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object ' <em><b>Version Spec</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.emfstore.internal.server.model.versioning.impl.VersionSpecImpl#getBranch <em>Branch</em>}
* </li>
* </ul>
* </p>
*
* @generated
*/
public abstract class VersionSpecImpl extends EObjectImpl implements VersionSpec {
/**
* The default value of the '{@link #getBranch() <em>Branch</em>}' attribute.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getBranch()
* @generated
* @ordered
*/
protected static final String BRANCH_EDEFAULT = "trunk"; //$NON-NLS-1$
/**
* The cached value of the '{@link #getBranch() <em>Branch</em>}' attribute.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getBranch()
* @generated
* @ordered
*/
protected String branch = BRANCH_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected VersionSpecImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return VersioningPackage.Literals.VERSION_SPEC;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getBranch() {
return branch;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setBranch(String newBranch) {
final String oldBranch = branch;
branch = newBranch;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, VersioningPackage.VERSION_SPEC__BRANCH, oldBranch,
branch));
}
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case VersioningPackage.VERSION_SPEC__BRANCH:
return getBranch();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case VersioningPackage.VERSION_SPEC__BRANCH:
setBranch((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case VersioningPackage.VERSION_SPEC__BRANCH:
setBranch(BRANCH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case VersioningPackage.VERSION_SPEC__BRANCH:
return BRANCH_EDEFAULT == null ? branch != null : !BRANCH_EDEFAULT.equals(branch);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
final StringBuffer result = new StringBuffer(super.toString());
result.append(" (branch: "); //$NON-NLS-1$
result.append(branch);
result.append(')');
return result.toString();
}
} // VersionSpecImpl