/** * 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.Interface; import org.occiware.clouddesigner.occi.infrastructure.impl.NetworkImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Interface</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.InterfaceImpl#getName <em>Name</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.InterfaceImpl#getType <em>Type</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.InterfaceImpl#getModel <em>Model</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.InterfaceImpl#getMac_addresss <em>Mac addresss</em>}</li> * <li>{@link org.occiware.clouddesigner.occi.hypervisor.impl.InterfaceImpl#getRoute <em>Route</em>}</li> * </ul> * * @generated */ public class InterfaceImpl extends NetworkImpl implements Interface { /** * 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 = "interface"; /** * 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 #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected static final String TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getType() <em>Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getType() * @generated * @ordered */ protected String type = TYPE_EDEFAULT; /** * The default value of the '{@link #getModel() <em>Model</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getModel() * @generated * @ordered */ protected static final String MODEL_EDEFAULT = null; /** * The cached value of the '{@link #getModel() <em>Model</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getModel() * @generated * @ordered */ protected String model = MODEL_EDEFAULT; /** * The default value of the '{@link #getMac_addresss() <em>Mac addresss</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMac_addresss() * @generated * @ordered */ protected static final String MAC_ADDRESSS_EDEFAULT = null; /** * The cached value of the '{@link #getMac_addresss() <em>Mac addresss</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getMac_addresss() * @generated * @ordered */ protected String mac_addresss = MAC_ADDRESSS_EDEFAULT; /** * The default value of the '{@link #getRoute() <em>Route</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRoute() * @generated * @ordered */ protected static final String ROUTE_EDEFAULT = null; /** * The cached value of the '{@link #getRoute() <em>Route</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getRoute() * @generated * @ordered */ protected String route = ROUTE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected InterfaceImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return HypervisorPackage.Literals.INTERFACE; } /** * <!-- 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.INTERFACE__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getType() { return type; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setType(String newType) { String oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.INTERFACE__TYPE, oldType, type)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getModel() { return model; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setModel(String newModel) { String oldModel = model; model = newModel; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.INTERFACE__MODEL, oldModel, model)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getMac_addresss() { return mac_addresss; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setMac_addresss(String newMac_addresss) { String oldMac_addresss = mac_addresss; mac_addresss = newMac_addresss; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.INTERFACE__MAC_ADDRESSS, oldMac_addresss, mac_addresss)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getRoute() { return route; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setRoute(String newRoute) { String oldRoute = route; route = newRoute; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, HypervisorPackage.INTERFACE__ROUTE, oldRoute, route)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case HypervisorPackage.INTERFACE__NAME: return getName(); case HypervisorPackage.INTERFACE__TYPE: return getType(); case HypervisorPackage.INTERFACE__MODEL: return getModel(); case HypervisorPackage.INTERFACE__MAC_ADDRESSS: return getMac_addresss(); case HypervisorPackage.INTERFACE__ROUTE: return getRoute(); } 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.INTERFACE__NAME: setName((String)newValue); return; case HypervisorPackage.INTERFACE__TYPE: setType((String)newValue); return; case HypervisorPackage.INTERFACE__MODEL: setModel((String)newValue); return; case HypervisorPackage.INTERFACE__MAC_ADDRESSS: setMac_addresss((String)newValue); return; case HypervisorPackage.INTERFACE__ROUTE: setRoute((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case HypervisorPackage.INTERFACE__NAME: setName(NAME_EDEFAULT); return; case HypervisorPackage.INTERFACE__TYPE: setType(TYPE_EDEFAULT); return; case HypervisorPackage.INTERFACE__MODEL: setModel(MODEL_EDEFAULT); return; case HypervisorPackage.INTERFACE__MAC_ADDRESSS: setMac_addresss(MAC_ADDRESSS_EDEFAULT); return; case HypervisorPackage.INTERFACE__ROUTE: setRoute(ROUTE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case HypervisorPackage.INTERFACE__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case HypervisorPackage.INTERFACE__TYPE: return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); case HypervisorPackage.INTERFACE__MODEL: return MODEL_EDEFAULT == null ? model != null : !MODEL_EDEFAULT.equals(model); case HypervisorPackage.INTERFACE__MAC_ADDRESSS: return MAC_ADDRESSS_EDEFAULT == null ? mac_addresss != null : !MAC_ADDRESSS_EDEFAULT.equals(mac_addresss); case HypervisorPackage.INTERFACE__ROUTE: return ROUTE_EDEFAULT == null ? route != null : !ROUTE_EDEFAULT.equals(route); } 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(", type: "); result.append(type); result.append(", model: "); result.append(model); result.append(", mac_addresss: "); result.append(mac_addresss); result.append(", route: "); result.append(route); result.append(')'); return result.toString(); } } //InterfaceImpl