/** * Copyright (c) 2015-2016 Inria * 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: * - Fawaz Paraiso <fawaz.paraiso@inria.fr> * - Philippe Merle <philippe.merle@inria.fr> */ package org.occiware.clouddesigner.occi.hypervisor.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.occiware.clouddesigner.occi.hypervisor.HypervisorPackage; import org.occiware.clouddesigner.occi.hypervisor.Parallel; import org.occiware.clouddesigner.occi.impl.ResourceImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Parallel</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.ParallelImpl#getName <em>Name</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.ParallelImpl#getSource <em>Source</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.ParallelImpl#getTarget <em>Target</em>}</li> * </ul> * * @generated */ public class ParallelImpl extends ResourceImpl implements Parallel { /** * 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 = "parallel"; /** * 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 #getSource() <em>Source</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSource() * @generated * @ordered */ protected static final String SOURCE_EDEFAULT = null; /** * The cached value of the '{@link #getSource() <em>Source</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getSource() * @generated * @ordered */ protected String source = SOURCE_EDEFAULT; /** * The default value of the '{@link #getTarget() <em>Target</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTarget() * @generated * @ordered */ protected static final String TARGET_EDEFAULT = null; /** * The cached value of the '{@link #getTarget() <em>Target</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTarget() * @generated * @ordered */ protected String target = TARGET_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ParallelImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return HypervisorPackage.Literals.PARALLEL; } /** * <!-- 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, HypervisorPackage.PARALLEL__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getSource() { return source; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSource(String newSource) { String oldSource = source; source = newSource; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.PARALLEL__SOURCE, oldSource, source)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getTarget() { return target; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTarget(String newTarget) { String oldTarget = target; target = newTarget; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.PARALLEL__TARGET, oldTarget, target)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case HypervisorPackage.PARALLEL__NAME: return getName(); case HypervisorPackage.PARALLEL__SOURCE: return getSource(); case HypervisorPackage.PARALLEL__TARGET: return getTarget(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case HypervisorPackage.PARALLEL__NAME: setName((String)newValue); return; case HypervisorPackage.PARALLEL__SOURCE: setSource((String)newValue); return; case HypervisorPackage.PARALLEL__TARGET: setTarget((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case HypervisorPackage.PARALLEL__NAME: setName(NAME_EDEFAULT); return; case HypervisorPackage.PARALLEL__SOURCE: setSource(SOURCE_EDEFAULT); return; case HypervisorPackage.PARALLEL__TARGET: setTarget(TARGET_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case HypervisorPackage.PARALLEL__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case HypervisorPackage.PARALLEL__SOURCE: return SOURCE_EDEFAULT == null ? source != null : !SOURCE_EDEFAULT.equals(source); case HypervisorPackage.PARALLEL__TARGET: return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target); } 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: "); result.append(name); result.append(", source: "); result.append(source); result.append(", target: "); result.append(target); result.append(')'); return result.toString(); } } //ParallelImpl