3 package org.simantics.aeri.redmine.core.settings.impl;
5 import org.eclipse.emf.common.notify.Notification;
7 import org.eclipse.emf.ecore.EClass;
9 import org.eclipse.emf.ecore.impl.ENotificationImpl;
10 import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
12 import org.simantics.aeri.redmine.core.settings.RedmineAERISettings;
13 import org.simantics.aeri.redmine.core.settings.RedmineAERISettingsPackage;
16 * <!-- begin-user-doc -->
17 * An implementation of the model object '<em><b>Redmine AERI Settings</b></em>'.
18 * <!-- end-user-doc -->
20 * The following features are implemented:
23 * <li>{@link org.simantics.aeri.redmine.core.settings.impl.RedmineAERISettingsImpl#getApiKey <em>Api Key</em>}</li>
28 public class RedmineAERISettingsImpl extends MinimalEObjectImpl.Container implements RedmineAERISettings {
30 * The default value of the '{@link #getApiKey() <em>Api Key</em>}' attribute.
31 * <!-- begin-user-doc -->
32 * <!-- end-user-doc -->
37 protected static final String API_KEY_EDEFAULT = null;
40 * The cached value of the '{@link #getApiKey() <em>Api Key</em>}' attribute.
41 * <!-- begin-user-doc -->
42 * <!-- end-user-doc -->
47 protected String apiKey = API_KEY_EDEFAULT;
50 * <!-- begin-user-doc -->
51 * <!-- end-user-doc -->
54 protected RedmineAERISettingsImpl() {
59 * <!-- begin-user-doc -->
60 * <!-- end-user-doc -->
64 protected EClass eStaticClass() {
65 return RedmineAERISettingsPackage.Literals.REDMINE_AERI_SETTINGS;
69 * <!-- begin-user-doc -->
70 * <!-- end-user-doc -->
73 public String getApiKey() {
78 * <!-- begin-user-doc -->
79 * <!-- end-user-doc -->
82 public void setApiKey(String newApiKey) {
83 String oldApiKey = apiKey;
85 if (eNotificationRequired())
86 eNotify(new ENotificationImpl(this, Notification.SET, RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY, oldApiKey, apiKey));
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
95 public Object eGet(int featureID, boolean resolve, boolean coreType) {
97 case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
100 return super.eGet(featureID, resolve, coreType);
104 * <!-- begin-user-doc -->
105 * <!-- end-user-doc -->
109 public void eSet(int featureID, Object newValue) {
111 case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
112 setApiKey((String)newValue);
115 super.eSet(featureID, newValue);
119 * <!-- begin-user-doc -->
120 * <!-- end-user-doc -->
124 public void eUnset(int featureID) {
126 case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
127 setApiKey(API_KEY_EDEFAULT);
130 super.eUnset(featureID);
134 * <!-- begin-user-doc -->
135 * <!-- end-user-doc -->
139 public boolean eIsSet(int featureID) {
141 case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
142 return API_KEY_EDEFAULT == null ? apiKey != null : !API_KEY_EDEFAULT.equals(apiKey);
144 return super.eIsSet(featureID);
148 * <!-- begin-user-doc -->
149 * <!-- end-user-doc -->
153 public String toString() {
154 if (eIsProxy()) return super.toString();
156 StringBuffer result = new StringBuffer(super.toString());
157 result.append(" (apiKey: ");
158 result.append(apiKey);
160 return result.toString();
163 } //RedmineAERISettingsImpl