blob: 013a6180d50773eaf82af1571c89de6d63cb2ad6 [file] [log] [blame]
/***************************************************************************************************
* Copyright (c) 2005-2007 Eteration A.S. and Gorkem Ercan 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: Gorkem Ercan
* Contributors: Naci Dai
*
**************************************************************************************************/
package org.eclipse.jst.server.generic.internal.servertype.definition.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.jst.server.generic.internal.servertype.definition.ServerTypePackage;
import org.eclipse.jst.server.generic.servertype.definition.Port;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Port</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getNo <em>No</em>}</li>
* <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.jst.server.generic.internal.servertype.definition.impl.PortImpl#getProtocol <em>Protocol</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class PortImpl extends EObjectImpl implements Port {
/**
* The default value of the '{@link #getNo() <em>No</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNo()
* @generated
* @ordered
*/
protected static final String NO_EDEFAULT = null;
/**
* The cached value of the '{@link #getNo() <em>No</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getNo()
* @generated
* @ordered
*/
protected String no = NO_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;
/**
* The default value of the '{@link #getProtocol() <em>Protocol</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProtocol()
* @generated
* @ordered
*/
protected static final String PROTOCOL_EDEFAULT = null;
/**
* The cached value of the '{@link #getProtocol() <em>Protocol</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProtocol()
* @generated
* @ordered
*/
protected String protocol = PROTOCOL_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PortImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return ServerTypePackage.Literals.PORT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getNo() {
return no;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setNo(String newNo) {
String oldNo = no;
no = newNo;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ServerTypePackage.PORT__NO, oldNo, no));
}
/**
* <!-- 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, ServerTypePackage.PORT__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getProtocol() {
return protocol;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setProtocol(String newProtocol) {
String oldProtocol = protocol;
protocol = newProtocol;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ServerTypePackage.PORT__PROTOCOL, oldProtocol, protocol));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ServerTypePackage.PORT__NO:
return getNo();
case ServerTypePackage.PORT__NAME:
return getName();
case ServerTypePackage.PORT__PROTOCOL:
return getProtocol();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ServerTypePackage.PORT__NO:
setNo((String)newValue);
return;
case ServerTypePackage.PORT__NAME:
setName((String)newValue);
return;
case ServerTypePackage.PORT__PROTOCOL:
setProtocol((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case ServerTypePackage.PORT__NO:
setNo(NO_EDEFAULT);
return;
case ServerTypePackage.PORT__NAME:
setName(NAME_EDEFAULT);
return;
case ServerTypePackage.PORT__PROTOCOL:
setProtocol(PROTOCOL_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case ServerTypePackage.PORT__NO:
return NO_EDEFAULT == null ? no != null : !NO_EDEFAULT.equals(no);
case ServerTypePackage.PORT__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case ServerTypePackage.PORT__PROTOCOL:
return PROTOCOL_EDEFAULT == null ? protocol != null : !PROTOCOL_EDEFAULT.equals(protocol);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (no: ");
result.append(no);
result.append(", name: ");
result.append(name);
result.append(", protocol: ");
result.append(protocol);
result.append(')');
return result.toString();
}
} //PortImpl