blob: af6af675621a1d3b2b08dcbefaa8453c59f0f714 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009, 2019 Xored Software Inc and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
/**
*/
package org.eclipse.rcptt.tesla.core.protocol.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.rcptt.tesla.core.protocol.ProtocolPackage;
import org.eclipse.rcptt.tesla.core.protocol.RapDownloadFile;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Rap Download File</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.RapDownloadFileImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.RapDownloadFileImpl#getUrl <em>Url</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.RapDownloadFileImpl#getHandler <em>Handler</em>}</li>
* <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.RapDownloadFileImpl#getContent <em>Content</em>}</li>
* </ul>
*
* @generated
*/
public class RapDownloadFileImpl extends EObjectImpl implements RapDownloadFile {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected int id = ID_EDEFAULT;
/**
* 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;
/**
* The default value of the '{@link #getHandler() <em>Handler</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHandler()
* @generated
* @ordered
*/
protected static final String HANDLER_EDEFAULT = null;
/**
* The cached value of the '{@link #getHandler() <em>Handler</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getHandler()
* @generated
* @ordered
*/
protected String handler = HANDLER_EDEFAULT;
/**
* The default value of the '{@link #getContent() <em>Content</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContent()
* @generated
* @ordered
*/
protected static final String CONTENT_EDEFAULT = null;
/**
* The cached value of the '{@link #getContent() <em>Content</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContent()
* @generated
* @ordered
*/
protected String content = CONTENT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected RapDownloadFileImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ProtocolPackage.Literals.RAP_DOWNLOAD_FILE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.RAP_DOWNLOAD_FILE__ID, oldId, id));
}
/**
* <!-- 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, ProtocolPackage.RAP_DOWNLOAD_FILE__URL, oldUrl, url));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getHandler() {
return handler;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHandler(String newHandler) {
String oldHandler = handler;
handler = newHandler;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.RAP_DOWNLOAD_FILE__HANDLER, oldHandler, handler));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getContent() {
return content;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContent(String newContent) {
String oldContent = content;
content = newContent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.RAP_DOWNLOAD_FILE__CONTENT, oldContent, content));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ProtocolPackage.RAP_DOWNLOAD_FILE__ID:
return getId();
case ProtocolPackage.RAP_DOWNLOAD_FILE__URL:
return getUrl();
case ProtocolPackage.RAP_DOWNLOAD_FILE__HANDLER:
return getHandler();
case ProtocolPackage.RAP_DOWNLOAD_FILE__CONTENT:
return getContent();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ProtocolPackage.RAP_DOWNLOAD_FILE__ID:
setId((Integer)newValue);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__URL:
setUrl((String)newValue);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__HANDLER:
setHandler((String)newValue);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__CONTENT:
setContent((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ProtocolPackage.RAP_DOWNLOAD_FILE__ID:
setId(ID_EDEFAULT);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__URL:
setUrl(URL_EDEFAULT);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__HANDLER:
setHandler(HANDLER_EDEFAULT);
return;
case ProtocolPackage.RAP_DOWNLOAD_FILE__CONTENT:
setContent(CONTENT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ProtocolPackage.RAP_DOWNLOAD_FILE__ID:
return id != ID_EDEFAULT;
case ProtocolPackage.RAP_DOWNLOAD_FILE__URL:
return URL_EDEFAULT == null ? url != null : !URL_EDEFAULT.equals(url);
case ProtocolPackage.RAP_DOWNLOAD_FILE__HANDLER:
return HANDLER_EDEFAULT == null ? handler != null : !HANDLER_EDEFAULT.equals(handler);
case ProtocolPackage.RAP_DOWNLOAD_FILE__CONTENT:
return CONTENT_EDEFAULT == null ? content != null : !CONTENT_EDEFAULT.equals(content);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (id: ");
result.append(id);
result.append(", url: ");
result.append(url);
result.append(", handler: ");
result.append(handler);
result.append(", content: ");
result.append(content);
result.append(')');
return result.toString();
}
} //RapDownloadFileImpl