blob: 254ebe80f5bdc8a4707917c1a7e79438d99e87e1 [file] [log] [blame]
/*******************************************************************************
* Copyright 2011 Chair for Applied Software Engineering,
* Technische Universitaet Muenchen.
* All rights reserved. This program and the accompanying materials
* are made available under 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.client.test.model.attachment.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.emfstore.client.test.model.attachment.AttachmentPackage;
import org.eclipse.emf.emfstore.client.test.model.attachment.UrlAttachment;
import org.eclipse.emf.emfstore.client.test.model.impl.AttachmentImpl;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Url Attachment</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.emfstore.client.test.model.attachment.impl.UrlAttachmentImpl#getUrl <em>Url</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class UrlAttachmentImpl extends AttachmentImpl implements UrlAttachment {
/**
* The default value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @see #getUrl()
* @generated
* @ordered
*/
protected static final String URL_EDEFAULT = null;
/**
* The cached value of the '{@link #getUrl() <em>Url</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getUrl()
* @generated
* @ordered
*/
protected String url = URL_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected UrlAttachmentImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return AttachmentPackage.Literals.URL_ATTACHMENT;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public String getUrl() {
return url;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setUrl(String newUrl) {
String oldUrl = url;
url = newUrl;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AttachmentPackage.URL_ATTACHMENT__URL, oldUrl, url));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AttachmentPackage.URL_ATTACHMENT__URL:
return getUrl();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AttachmentPackage.URL_ATTACHMENT__URL:
setUrl((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AttachmentPackage.URL_ATTACHMENT__URL:
setUrl(URL_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AttachmentPackage.URL_ATTACHMENT__URL:
return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url);
}
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(" (url: ");
result.append(url);
result.append(')');
return result.toString();
}
} // UrlAttachmentImpl