blob: aa15f76b3d0637ad82a984c4267047ba2eaad3fa [file] [log] [blame]
/**
*/
package org.eclipse.blockchain.model.ethproject.impl;
import org.eclipse.blockchain.model.ethproject.DeploymentModel;
import org.eclipse.blockchain.model.ethproject.EthprojectPackage;
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>Deployment Model</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.DeploymentModelImpl#getContractAddress <em>Contract Address</em>}</li>
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.DeploymentModelImpl#getScFile <em>Sc File</em>}</li>
* <li>{@link org.eclipse.blockchain.model.ethproject.impl.DeploymentModelImpl#getLastUsedAccount <em>Last Used Account</em>}</li>
* </ul>
*
* @generated
*/
public class DeploymentModelImpl extends MinimalEObjectImpl.Container implements DeploymentModel {
/**
* The default value of the '{@link #getContractAddress() <em>Contract Address</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContractAddress()
* @generated
* @ordered
*/
protected static final String CONTRACT_ADDRESS_EDEFAULT = null;
/**
* The cached value of the '{@link #getContractAddress() <em>Contract Address</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getContractAddress()
* @generated
* @ordered
*/
protected String contractAddress = CONTRACT_ADDRESS_EDEFAULT;
/**
* The default value of the '{@link #getScFile() <em>Sc File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScFile()
* @generated
* @ordered
*/
protected static final IResource SC_FILE_EDEFAULT = null;
/**
* The cached value of the '{@link #getScFile() <em>Sc File</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getScFile()
* @generated
* @ordered
*/
protected IResource scFile = SC_FILE_EDEFAULT;
/**
* The default value of the '{@link #getLastUsedAccount() <em>Last Used Account</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLastUsedAccount()
* @generated
* @ordered
*/
protected static final String LAST_USED_ACCOUNT_EDEFAULT = null;
/**
* The cached value of the '{@link #getLastUsedAccount() <em>Last Used Account</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLastUsedAccount()
* @generated
* @ordered
*/
protected String lastUsedAccount = LAST_USED_ACCOUNT_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected DeploymentModelImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return EthprojectPackage.Literals.DEPLOYMENT_MODEL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getContractAddress() {
return contractAddress;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setContractAddress(String newContractAddress) {
String oldContractAddress = contractAddress;
contractAddress = newContractAddress;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.DEPLOYMENT_MODEL__CONTRACT_ADDRESS,
oldContractAddress, contractAddress));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IResource getScFile() {
return scFile;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setScFile(IResource newScFile) {
IResource oldScFile = scFile;
scFile = newScFile;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.DEPLOYMENT_MODEL__SC_FILE, oldScFile,
scFile));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getLastUsedAccount() {
return lastUsedAccount;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLastUsedAccount(String newLastUsedAccount) {
String oldLastUsedAccount = lastUsedAccount;
lastUsedAccount = newLastUsedAccount;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EthprojectPackage.DEPLOYMENT_MODEL__LAST_USED_ACCOUNT,
oldLastUsedAccount, lastUsedAccount));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EthprojectPackage.DEPLOYMENT_MODEL__CONTRACT_ADDRESS:
return getContractAddress();
case EthprojectPackage.DEPLOYMENT_MODEL__SC_FILE:
return getScFile();
case EthprojectPackage.DEPLOYMENT_MODEL__LAST_USED_ACCOUNT:
return getLastUsedAccount();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EthprojectPackage.DEPLOYMENT_MODEL__CONTRACT_ADDRESS:
setContractAddress((String) newValue);
return;
case EthprojectPackage.DEPLOYMENT_MODEL__SC_FILE:
setScFile((IResource) newValue);
return;
case EthprojectPackage.DEPLOYMENT_MODEL__LAST_USED_ACCOUNT:
setLastUsedAccount((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case EthprojectPackage.DEPLOYMENT_MODEL__CONTRACT_ADDRESS:
setContractAddress(CONTRACT_ADDRESS_EDEFAULT);
return;
case EthprojectPackage.DEPLOYMENT_MODEL__SC_FILE:
setScFile(SC_FILE_EDEFAULT);
return;
case EthprojectPackage.DEPLOYMENT_MODEL__LAST_USED_ACCOUNT:
setLastUsedAccount(LAST_USED_ACCOUNT_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case EthprojectPackage.DEPLOYMENT_MODEL__CONTRACT_ADDRESS:
return CONTRACT_ADDRESS_EDEFAULT == null ? contractAddress != null
: !CONTRACT_ADDRESS_EDEFAULT.equals(contractAddress);
case EthprojectPackage.DEPLOYMENT_MODEL__SC_FILE:
return SC_FILE_EDEFAULT == null ? scFile != null : !SC_FILE_EDEFAULT.equals(scFile);
case EthprojectPackage.DEPLOYMENT_MODEL__LAST_USED_ACCOUNT:
return LAST_USED_ACCOUNT_EDEFAULT == null ? lastUsedAccount != null
: !LAST_USED_ACCOUNT_EDEFAULT.equals(lastUsedAccount);
}
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(" (contractAddress: ");
result.append(contractAddress);
result.append(", scFile: ");
result.append(scFile);
result.append(", lastUsedAccount: ");
result.append(lastUsedAccount);
result.append(')');
return result.toString();
}
} //DeploymentModelImpl