/*******************************************************************************
* Copyright (c) 2008-2010 Sonatype, Inc.
* 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:
* Sonatype, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.m2e.model.edit.pom.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.m2e.model.edit.pom.PomPackage;
import org.eclipse.m2e.model.edit.pom.Site;
/**
* An implementation of the model object '
* Site'.
*
* The following features are implemented:
*
* - {@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getId Id}
* - {@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getName Name}
* - {@link org.eclipse.m2e.model.edit.pom.impl.SiteImpl#getUrl Url}
*
*
*
* @generated
*/
public class SiteImpl extends EObjectImpl implements Site {
/**
* The default value of the '{@link #getId() Id}' attribute.
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() Name}' attribute.
*
*
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getUrl() Url}' attribute.
*
* @see #getUrl()
* @generated
* @ordered
*/
protected static final String URL_EDEFAULT = null;
/**
* The cached value of the '{@link #getUrl() Url}' attribute.
*
* @see #getUrl()
* @generated
* @ordered
*/
protected String url = URL_EDEFAULT;
/**
*
*
* @generated
*/
protected SiteImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return PomPackage.Literals.SITE;
}
/**
*
*
* @generated
*/
public String getId() {
return id;
}
/**
*
*
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
PomPackage.SITE__ID, oldId, id));
}
/**
*
*
* @generated
*/
public String getName() {
return name;
}
/**
*
*
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
PomPackage.SITE__NAME, oldName, name));
}
/**
*
*
* @generated
*/
public String getUrl() {
return url;
}
/**
*
*
* @generated
*/
public void setUrl(String newUrl) {
String oldUrl = url;
url = newUrl;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
PomPackage.SITE__URL, oldUrl, url));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PomPackage.SITE__ID:
return getId();
case PomPackage.SITE__NAME:
return getName();
case PomPackage.SITE__URL:
return getUrl();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case PomPackage.SITE__ID:
setId((String) newValue);
return;
case PomPackage.SITE__NAME:
setName((String) newValue);
return;
case PomPackage.SITE__URL:
setUrl((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PomPackage.SITE__ID:
setId(ID_EDEFAULT);
return;
case PomPackage.SITE__NAME:
setName(NAME_EDEFAULT);
return;
case PomPackage.SITE__URL:
setUrl(URL_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PomPackage.SITE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case PomPackage.SITE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT
.equals(name);
case PomPackage.SITE__URL:
return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT
.equals(url);
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: "); //$NON-NLS-1$
result.append(id);
result.append(", name: "); //$NON-NLS-1$
result.append(name);
result.append(", url: "); //$NON-NLS-1$
result.append(url);
result.append(')');
return result.toString();
}
} // SiteImpl