blob: d1893bde1191fe131a850dc1ab7d609c9a9c685e [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014 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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Xored Software Inc - initial API and implementation and/or initial documentation
*******************************************************************************/
package org.eclipse.rcptt.ecl.filesystem.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.rcptt.ecl.core.impl.CommandImpl;
import org.eclipse.rcptt.ecl.filesystem.CopyFile;
import org.eclipse.rcptt.ecl.filesystem.FilesystemPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Copy File</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.rcptt.ecl.filesystem.impl.CopyFileImpl#getSource <em>Source</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.filesystem.impl.CopyFileImpl#getDestination <em>Destination</em>}</li>
* <li>{@link org.eclipse.rcptt.ecl.filesystem.impl.CopyFileImpl#getName <em>Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CopyFileImpl extends CommandImpl implements CopyFile {
/**
* The default value of the '{@link #getSource() <em>Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSource()
* @generated
* @ordered
*/
protected static final String SOURCE_EDEFAULT = null;
/**
* The cached value of the '{@link #getSource() <em>Source</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSource()
* @generated
* @ordered
*/
protected String source = SOURCE_EDEFAULT;
/**
* The default value of the '{@link #getDestination() <em>Destination</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDestination()
* @generated
* @ordered
*/
protected static final String DESTINATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDestination() <em>Destination</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDestination()
* @generated
* @ordered
*/
protected String destination = DESTINATION_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;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CopyFileImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return FilesystemPackage.Literals.COPY_FILE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getSource() {
return source;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSource(String newSource) {
String oldSource = source;
source = newSource;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.COPY_FILE__SOURCE, oldSource, source));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDestination() {
return destination;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDestination(String newDestination) {
String oldDestination = destination;
destination = newDestination;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, FilesystemPackage.COPY_FILE__DESTINATION, oldDestination, destination));
}
/**
* <!-- 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, FilesystemPackage.COPY_FILE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case FilesystemPackage.COPY_FILE__SOURCE:
return getSource();
case FilesystemPackage.COPY_FILE__DESTINATION:
return getDestination();
case FilesystemPackage.COPY_FILE__NAME:
return getName();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case FilesystemPackage.COPY_FILE__SOURCE:
setSource((String)newValue);
return;
case FilesystemPackage.COPY_FILE__DESTINATION:
setDestination((String)newValue);
return;
case FilesystemPackage.COPY_FILE__NAME:
setName((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case FilesystemPackage.COPY_FILE__SOURCE:
setSource(SOURCE_EDEFAULT);
return;
case FilesystemPackage.COPY_FILE__DESTINATION:
setDestination(DESTINATION_EDEFAULT);
return;
case FilesystemPackage.COPY_FILE__NAME:
setName(NAME_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case FilesystemPackage.COPY_FILE__SOURCE:
return SOURCE_EDEFAULT == null ? source != null : !SOURCE_EDEFAULT.equals(source);
case FilesystemPackage.COPY_FILE__DESTINATION:
return DESTINATION_EDEFAULT == null ? destination != null : !DESTINATION_EDEFAULT.equals(destination);
case FilesystemPackage.COPY_FILE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
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(" (source: ");
result.append(source);
result.append(", destination: ");
result.append(destination);
result.append(", name: ");
result.append(name);
result.append(')');
return result.toString();
}
} //CopyFileImpl