/** | |
*/ | |
package org.eclipse.blockchain.model.ethproject.impl; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
import org.eclipse.blockchain.model.ethproject.DeploymentModel; | |
import org.eclipse.blockchain.model.ethproject.EthereumProject; | |
import org.eclipse.blockchain.model.ethproject.EthprojectPackage; | |
import org.eclipse.core.resources.IFile; | |
import org.eclipse.core.resources.IProject; | |
import org.eclipse.core.resources.IProjectDescription; | |
import org.eclipse.core.resources.IResource; | |
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.MinimalEObjectImpl; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Ethereum Project</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getProjectLocation <em>Project Location</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getProjectDescription <em>Project Description</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getProject <em>Project</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getFirstMatchingSolFile <em>First Matching Sol File</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getProjectNatures <em>Project Natures</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getCompiledSolidityFiles <em>Compiled Solidity Files</em>}</li> | |
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.EthereumProjectImpl#getEnvironmentBasedDeployedModel <em>Environment Based Deployed Model</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public class EthereumProjectImpl extends MinimalEObjectImpl.Container implements EthereumProject { | |
/** | |
* The default value of the '{@link #getProjectLocation() <em>Project Location</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectLocation() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String PROJECT_LOCATION_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getProjectLocation() <em>Project Location</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectLocation() | |
* @generated | |
* @ordered | |
*/ | |
protected String projectLocation = PROJECT_LOCATION_EDEFAULT; | |
/** | |
* The default value of the '{@link #getProjectDescription() <em>Project Description</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectDescription() | |
* @generated | |
* @ordered | |
*/ | |
protected static final IProjectDescription PROJECT_DESCRIPTION_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getProjectDescription() <em>Project Description</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectDescription() | |
* @generated | |
* @ordered | |
*/ | |
protected IProjectDescription projectDescription = PROJECT_DESCRIPTION_EDEFAULT; | |
/** | |
* The default value of the '{@link #getProject() <em>Project</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProject() | |
* @generated | |
* @ordered | |
*/ | |
protected static final IProject PROJECT_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getProject() <em>Project</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProject() | |
* @generated | |
* @ordered | |
*/ | |
protected IProject project = PROJECT_EDEFAULT; | |
/** | |
* The default value of the '{@link #getFirstMatchingSolFile() <em>First Matching Sol File</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFirstMatchingSolFile() | |
* @generated | |
* @ordered | |
*/ | |
protected static final IFile FIRST_MATCHING_SOL_FILE_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getFirstMatchingSolFile() <em>First Matching Sol File</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFirstMatchingSolFile() | |
* @generated | |
* @ordered | |
*/ | |
protected IFile firstMatchingSolFile = FIRST_MATCHING_SOL_FILE_EDEFAULT; | |
/** | |
* The default value of the '{@link #getProjectNatures() <em>Project Natures</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectNatures() | |
* @generated | |
* @ordered | |
*/ | |
protected static final List<String> PROJECT_NATURES_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getProjectNatures() <em>Project Natures</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProjectNatures() | |
* @generated | |
* @ordered | |
*/ | |
protected List<String> projectNatures = PROJECT_NATURES_EDEFAULT; | |
/** | |
* The default value of the '{@link #getCompiledSolidityFiles() <em>Compiled Solidity Files</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getCompiledSolidityFiles() | |
* @generated | |
* @ordered | |
*/ | |
protected static final Set<IResource> COMPILED_SOLIDITY_FILES_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getCompiledSolidityFiles() <em>Compiled Solidity Files</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getCompiledSolidityFiles() | |
* @generated | |
* @ordered | |
*/ | |
protected Set<IResource> compiledSolidityFiles = COMPILED_SOLIDITY_FILES_EDEFAULT; | |
/** | |
* The default value of the '{@link #getEnvironmentBasedDeployedModel() <em>Environment Based Deployed Model</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEnvironmentBasedDeployedModel() | |
* @generated | |
* @ordered | |
*/ | |
protected static final Map<String, Map<IResource, DeploymentModel>> ENVIRONMENT_BASED_DEPLOYED_MODEL_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getEnvironmentBasedDeployedModel() <em>Environment Based Deployed Model</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getEnvironmentBasedDeployedModel() | |
* @generated | |
* @ordered | |
*/ | |
protected Map<String, Map<IResource, DeploymentModel>> environmentBasedDeployedModel = | |
ENVIRONMENT_BASED_DEPLOYED_MODEL_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected EthereumProjectImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return EthprojectPackage.Literals.ETHEREUM_PROJECT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getProjectLocation() { | |
return projectLocation; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setProjectLocation(String newProjectLocation) { | |
String oldProjectLocation = projectLocation; | |
projectLocation = newProjectLocation; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__PROJECT_LOCATION, | |
oldProjectLocation, projectLocation)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IProjectDescription getProjectDescription() { | |
return projectDescription; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setProjectDescription(IProjectDescription newProjectDescription) { | |
IProjectDescription oldProjectDescription = projectDescription; | |
projectDescription = newProjectDescription; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__PROJECT_DESCRIPTION, | |
oldProjectDescription, projectDescription)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IProject getProject() { | |
return project; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setProject(IProject newProject) { | |
IProject oldProject = project; | |
project = newProject; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__PROJECT, oldProject, | |
project)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public IFile getFirstMatchingSolFile() { | |
return firstMatchingSolFile; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setFirstMatchingSolFile(IFile newFirstMatchingSolFile) { | |
IFile oldFirstMatchingSolFile = firstMatchingSolFile; | |
firstMatchingSolFile = newFirstMatchingSolFile; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__FIRST_MATCHING_SOL_FILE, | |
oldFirstMatchingSolFile, firstMatchingSolFile)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public List<String> getProjectNatures() { | |
return projectNatures; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setProjectNatures(List<String> newProjectNatures) { | |
List<String> oldProjectNatures = projectNatures; | |
projectNatures = newProjectNatures; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__PROJECT_NATURES, | |
oldProjectNatures, projectNatures)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Set<IResource> getCompiledSolidityFiles() { | |
return compiledSolidityFiles; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setCompiledSolidityFiles(Set<IResource> newCompiledSolidityFiles) { | |
Set<IResource> oldCompiledSolidityFiles = compiledSolidityFiles; | |
compiledSolidityFiles = newCompiledSolidityFiles; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.ETHEREUM_PROJECT__COMPILED_SOLIDITY_FILES, | |
oldCompiledSolidityFiles, compiledSolidityFiles)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public Map<String, Map<IResource, DeploymentModel>> getEnvironmentBasedDeployedModel() { | |
return environmentBasedDeployedModel; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setEnvironmentBasedDeployedModel( | |
Map<String, Map<IResource, DeploymentModel>> newEnvironmentBasedDeployedModel) { | |
Map<String, Map<IResource, DeploymentModel>> oldEnvironmentBasedDeployedModel = environmentBasedDeployedModel; | |
environmentBasedDeployedModel = newEnvironmentBasedDeployedModel; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, | |
EthprojectPackage.ETHEREUM_PROJECT__ENVIRONMENT_BASED_DEPLOYED_MODEL, oldEnvironmentBasedDeployedModel, | |
environmentBasedDeployedModel)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_LOCATION: | |
return getProjectLocation(); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_DESCRIPTION: | |
return getProjectDescription(); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT: | |
return getProject(); | |
case EthprojectPackage.ETHEREUM_PROJECT__FIRST_MATCHING_SOL_FILE: | |
return getFirstMatchingSolFile(); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_NATURES: | |
return getProjectNatures(); | |
case EthprojectPackage.ETHEREUM_PROJECT__COMPILED_SOLIDITY_FILES: | |
return getCompiledSolidityFiles(); | |
case EthprojectPackage.ETHEREUM_PROJECT__ENVIRONMENT_BASED_DEPLOYED_MODEL: | |
return getEnvironmentBasedDeployedModel(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_LOCATION: | |
setProjectLocation((String) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_DESCRIPTION: | |
setProjectDescription((IProjectDescription) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT: | |
setProject((IProject) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__FIRST_MATCHING_SOL_FILE: | |
setFirstMatchingSolFile((IFile) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_NATURES: | |
setProjectNatures((List<String>) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__COMPILED_SOLIDITY_FILES: | |
setCompiledSolidityFiles((Set<IResource>) newValue); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__ENVIRONMENT_BASED_DEPLOYED_MODEL: | |
setEnvironmentBasedDeployedModel((Map<String, Map<IResource, DeploymentModel>>) newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_LOCATION: | |
setProjectLocation(PROJECT_LOCATION_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_DESCRIPTION: | |
setProjectDescription(PROJECT_DESCRIPTION_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT: | |
setProject(PROJECT_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__FIRST_MATCHING_SOL_FILE: | |
setFirstMatchingSolFile(FIRST_MATCHING_SOL_FILE_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_NATURES: | |
setProjectNatures(PROJECT_NATURES_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__COMPILED_SOLIDITY_FILES: | |
setCompiledSolidityFiles(COMPILED_SOLIDITY_FILES_EDEFAULT); | |
return; | |
case EthprojectPackage.ETHEREUM_PROJECT__ENVIRONMENT_BASED_DEPLOYED_MODEL: | |
setEnvironmentBasedDeployedModel(ENVIRONMENT_BASED_DEPLOYED_MODEL_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_LOCATION: | |
return PROJECT_LOCATION_EDEFAULT == null ? projectLocation != null | |
: !PROJECT_LOCATION_EDEFAULT.equals(projectLocation); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_DESCRIPTION: | |
return PROJECT_DESCRIPTION_EDEFAULT == null ? projectDescription != null | |
: !PROJECT_DESCRIPTION_EDEFAULT.equals(projectDescription); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT: | |
return PROJECT_EDEFAULT == null ? project != null : !PROJECT_EDEFAULT.equals(project); | |
case EthprojectPackage.ETHEREUM_PROJECT__FIRST_MATCHING_SOL_FILE: | |
return FIRST_MATCHING_SOL_FILE_EDEFAULT == null ? firstMatchingSolFile != null | |
: !FIRST_MATCHING_SOL_FILE_EDEFAULT.equals(firstMatchingSolFile); | |
case EthprojectPackage.ETHEREUM_PROJECT__PROJECT_NATURES: | |
return PROJECT_NATURES_EDEFAULT == null ? projectNatures != null | |
: !PROJECT_NATURES_EDEFAULT.equals(projectNatures); | |
case EthprojectPackage.ETHEREUM_PROJECT__COMPILED_SOLIDITY_FILES: | |
return COMPILED_SOLIDITY_FILES_EDEFAULT == null ? compiledSolidityFiles != null | |
: !COMPILED_SOLIDITY_FILES_EDEFAULT.equals(compiledSolidityFiles); | |
case EthprojectPackage.ETHEREUM_PROJECT__ENVIRONMENT_BASED_DEPLOYED_MODEL: | |
return ENVIRONMENT_BASED_DEPLOYED_MODEL_EDEFAULT == null ? environmentBasedDeployedModel != null | |
: !ENVIRONMENT_BASED_DEPLOYED_MODEL_EDEFAULT.equals(environmentBasedDeployedModel); | |
} | |
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(" (projectLocation: "); | |
result.append(projectLocation); | |
result.append(", projectDescription: "); | |
result.append(projectDescription); | |
result.append(", project: "); | |
result.append(project); | |
result.append(", firstMatchingSolFile: "); | |
result.append(firstMatchingSolFile); | |
result.append(", projectNatures: "); | |
result.append(projectNatures); | |
result.append(", compiledSolidityFiles: "); | |
result.append(compiledSolidityFiles); | |
result.append(", environmentBasedDeployedModel: "); | |
result.append(environmentBasedDeployedModel); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //EthereumProjectImpl |