]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.aeri.ui.redmine.core/src/org/simantics/aeri/redmine/core/settings/impl/RedmineAERISettingsImpl.java
Experiment around with AERI in Simantics Products
[simantics/platform.git] / bundles / org.simantics.aeri.ui.redmine.core / src / org / simantics / aeri / redmine / core / settings / impl / RedmineAERISettingsImpl.java
1 /**
2  */
3 package org.simantics.aeri.redmine.core.settings.impl;
4
5 import org.eclipse.emf.common.notify.Notification;
6
7 import org.eclipse.emf.ecore.EClass;
8
9 import org.eclipse.emf.ecore.impl.ENotificationImpl;
10 import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
11
12 import org.simantics.aeri.redmine.core.settings.RedmineAERISettings;
13 import org.simantics.aeri.redmine.core.settings.RedmineAERISettingsPackage;
14
15 /**
16  * <!-- begin-user-doc -->
17  * An implementation of the model object '<em><b>Redmine AERI Settings</b></em>'.
18  * <!-- end-user-doc -->
19  * <p>
20  * The following features are implemented:
21  * </p>
22  * <ul>
23  *   <li>{@link org.simantics.aeri.redmine.core.settings.impl.RedmineAERISettingsImpl#getApiKey <em>Api Key</em>}</li>
24  * </ul>
25  *
26  * @generated
27  */
28 public class RedmineAERISettingsImpl extends MinimalEObjectImpl.Container implements RedmineAERISettings {
29     /**
30      * The default value of the '{@link #getApiKey() <em>Api Key</em>}' attribute.
31      * <!-- begin-user-doc -->
32      * <!-- end-user-doc -->
33      * @see #getApiKey()
34      * @generated
35      * @ordered
36      */
37     protected static final String API_KEY_EDEFAULT = null;
38
39     /**
40      * The cached value of the '{@link #getApiKey() <em>Api Key</em>}' attribute.
41      * <!-- begin-user-doc -->
42      * <!-- end-user-doc -->
43      * @see #getApiKey()
44      * @generated
45      * @ordered
46      */
47     protected String apiKey = API_KEY_EDEFAULT;
48
49     /**
50      * <!-- begin-user-doc -->
51      * <!-- end-user-doc -->
52      * @generated
53      */
54     protected RedmineAERISettingsImpl() {
55         super();
56     }
57
58     /**
59      * <!-- begin-user-doc -->
60      * <!-- end-user-doc -->
61      * @generated
62      */
63     @Override
64     protected EClass eStaticClass() {
65         return RedmineAERISettingsPackage.Literals.REDMINE_AERI_SETTINGS;
66     }
67
68     /**
69      * <!-- begin-user-doc -->
70      * <!-- end-user-doc -->
71      * @generated
72      */
73     public String getApiKey() {
74         return apiKey;
75     }
76
77     /**
78      * <!-- begin-user-doc -->
79      * <!-- end-user-doc -->
80      * @generated
81      */
82     public void setApiKey(String newApiKey) {
83         String oldApiKey = apiKey;
84         apiKey = newApiKey;
85         if (eNotificationRequired())
86             eNotify(new ENotificationImpl(this, Notification.SET, RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY, oldApiKey, apiKey));
87     }
88
89     /**
90      * <!-- begin-user-doc -->
91      * <!-- end-user-doc -->
92      * @generated
93      */
94     @Override
95     public Object eGet(int featureID, boolean resolve, boolean coreType) {
96         switch (featureID) {
97             case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
98                 return getApiKey();
99         }
100         return super.eGet(featureID, resolve, coreType);
101     }
102
103     /**
104      * <!-- begin-user-doc -->
105      * <!-- end-user-doc -->
106      * @generated
107      */
108     @Override
109     public void eSet(int featureID, Object newValue) {
110         switch (featureID) {
111             case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
112                 setApiKey((String)newValue);
113                 return;
114         }
115         super.eSet(featureID, newValue);
116     }
117
118     /**
119      * <!-- begin-user-doc -->
120      * <!-- end-user-doc -->
121      * @generated
122      */
123     @Override
124     public void eUnset(int featureID) {
125         switch (featureID) {
126             case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
127                 setApiKey(API_KEY_EDEFAULT);
128                 return;
129         }
130         super.eUnset(featureID);
131     }
132
133     /**
134      * <!-- begin-user-doc -->
135      * <!-- end-user-doc -->
136      * @generated
137      */
138     @Override
139     public boolean eIsSet(int featureID) {
140         switch (featureID) {
141             case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS__API_KEY:
142                 return API_KEY_EDEFAULT == null ? apiKey != null : !API_KEY_EDEFAULT.equals(apiKey);
143         }
144         return super.eIsSet(featureID);
145     }
146
147     /**
148      * <!-- begin-user-doc -->
149      * <!-- end-user-doc -->
150      * @generated
151      */
152     @Override
153     public String toString() {
154         if (eIsProxy()) return super.toString();
155
156         StringBuffer result = new StringBuffer(super.toString());
157         result.append(" (apiKey: ");
158         result.append(apiKey);
159         result.append(')');
160         return result.toString();
161     }
162
163 } //RedmineAERISettingsImpl