001 /** 002 * <copyright> 003 * </copyright> 004 * 005 * $Id$ 006 */ 007 package com.hammurapi.review.impl; 008 009 import org.eclipse.emf.common.notify.Notification; 010 import org.eclipse.emf.ecore.EClass; 011 import org.eclipse.emf.ecore.InternalEObject; 012 import org.eclipse.emf.ecore.impl.ENotificationImpl; 013 import org.eclipse.emf.ecore.impl.EObjectImpl; 014 015 import com.hammurapi.review.Inspector; 016 import com.hammurapi.review.ReviewPackage; 017 import com.hammurapi.review.Waiver; 018 019 /** 020 * <!-- begin-user-doc --> 021 * An implementation of the model object '<em><b>Waiver</b></em>'. 022 * <!-- end-user-doc --> 023 * <p> 024 * The following features are implemented: 025 * <ul> 026 * <li>{@link com.hammurapi.review.impl.WaiverImpl#getSignature <em>Signature</em>}</li> 027 * <li>{@link com.hammurapi.review.impl.WaiverImpl#getInspector <em>Inspector</em>}</li> 028 * <li>{@link com.hammurapi.review.impl.WaiverImpl#getExpirationTime <em>Expiration Time</em>}</li> 029 * <li>{@link com.hammurapi.review.impl.WaiverImpl#getComment <em>Comment</em>}</li> 030 * </ul> 031 * </p> 032 * 033 * @generated 034 */ 035 public class WaiverImpl extends EObjectImpl implements Waiver { 036 /** 037 * The default value of the '{@link #getSignature() <em>Signature</em>}' attribute. 038 * <!-- begin-user-doc --> 039 * <!-- end-user-doc --> 040 * @see #getSignature() 041 * @generated 042 * @ordered 043 */ 044 protected static final String SIGNATURE_EDEFAULT = null; 045 046 /** 047 * The cached value of the '{@link #getSignature() <em>Signature</em>}' attribute. 048 * <!-- begin-user-doc --> 049 * <!-- end-user-doc --> 050 * @see #getSignature() 051 * @generated 052 * @ordered 053 */ 054 protected String signature = SIGNATURE_EDEFAULT; 055 056 /** 057 * The cached value of the '{@link #getInspector() <em>Inspector</em>}' reference. 058 * <!-- begin-user-doc --> 059 * <!-- end-user-doc --> 060 * @see #getInspector() 061 * @generated 062 * @ordered 063 */ 064 protected Inspector inspector; 065 066 /** 067 * The default value of the '{@link #getExpirationTime() <em>Expiration Time</em>}' attribute. 068 * <!-- begin-user-doc --> 069 * <!-- end-user-doc --> 070 * @see #getExpirationTime() 071 * @generated 072 * @ordered 073 */ 074 protected static final long EXPIRATION_TIME_EDEFAULT = 0L; 075 076 /** 077 * The cached value of the '{@link #getExpirationTime() <em>Expiration Time</em>}' attribute. 078 * <!-- begin-user-doc --> 079 * <!-- end-user-doc --> 080 * @see #getExpirationTime() 081 * @generated 082 * @ordered 083 */ 084 protected long expirationTime = EXPIRATION_TIME_EDEFAULT; 085 086 /** 087 * The default value of the '{@link #getComment() <em>Comment</em>}' attribute. 088 * <!-- begin-user-doc --> 089 * <!-- end-user-doc --> 090 * @see #getComment() 091 * @generated 092 * @ordered 093 */ 094 protected static final String COMMENT_EDEFAULT = null; 095 096 /** 097 * The cached value of the '{@link #getComment() <em>Comment</em>}' attribute. 098 * <!-- begin-user-doc --> 099 * <!-- end-user-doc --> 100 * @see #getComment() 101 * @generated 102 * @ordered 103 */ 104 protected String comment = COMMENT_EDEFAULT; 105 106 /** 107 * <!-- begin-user-doc --> 108 * <!-- end-user-doc --> 109 * @generated 110 */ 111 protected WaiverImpl() { 112 super(); 113 } 114 115 /** 116 * <!-- begin-user-doc --> 117 * <!-- end-user-doc --> 118 * @generated 119 */ 120 @Override 121 protected EClass eStaticClass() { 122 return ReviewPackage.Literals.WAIVER; 123 } 124 125 /** 126 * <!-- begin-user-doc --> 127 * <!-- end-user-doc --> 128 * @generated 129 */ 130 public String getSignature() { 131 return signature; 132 } 133 134 /** 135 * <!-- begin-user-doc --> 136 * <!-- end-user-doc --> 137 * @generated 138 */ 139 public void setSignature(String newSignature) { 140 String oldSignature = signature; 141 signature = newSignature; 142 if (eNotificationRequired()) 143 eNotify(new ENotificationImpl(this, Notification.SET, ReviewPackage.WAIVER__SIGNATURE, oldSignature, signature)); 144 } 145 146 /** 147 * <!-- begin-user-doc --> 148 * <!-- end-user-doc --> 149 * @generated 150 */ 151 public Inspector getInspector() { 152 if (inspector != null && inspector.eIsProxy()) { 153 InternalEObject oldInspector = (InternalEObject)inspector; 154 inspector = (Inspector)eResolveProxy(oldInspector); 155 if (inspector != oldInspector) { 156 if (eNotificationRequired()) 157 eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewPackage.WAIVER__INSPECTOR, oldInspector, inspector)); 158 } 159 } 160 return inspector; 161 } 162 163 /** 164 * <!-- begin-user-doc --> 165 * <!-- end-user-doc --> 166 * @generated 167 */ 168 public Inspector basicGetInspector() { 169 return inspector; 170 } 171 172 /** 173 * <!-- begin-user-doc --> 174 * <!-- end-user-doc --> 175 * @generated 176 */ 177 public void setInspector(Inspector newInspector) { 178 Inspector oldInspector = inspector; 179 inspector = newInspector; 180 if (eNotificationRequired()) 181 eNotify(new ENotificationImpl(this, Notification.SET, ReviewPackage.WAIVER__INSPECTOR, oldInspector, inspector)); 182 } 183 184 /** 185 * <!-- begin-user-doc --> 186 * <!-- end-user-doc --> 187 * @generated 188 */ 189 public long getExpirationTime() { 190 return expirationTime; 191 } 192 193 /** 194 * <!-- begin-user-doc --> 195 * <!-- end-user-doc --> 196 * @generated 197 */ 198 public void setExpirationTime(long newExpirationTime) { 199 long oldExpirationTime = expirationTime; 200 expirationTime = newExpirationTime; 201 if (eNotificationRequired()) 202 eNotify(new ENotificationImpl(this, Notification.SET, ReviewPackage.WAIVER__EXPIRATION_TIME, oldExpirationTime, expirationTime)); 203 } 204 205 /** 206 * <!-- begin-user-doc --> 207 * <!-- end-user-doc --> 208 * @generated 209 */ 210 public String getComment() { 211 return comment; 212 } 213 214 /** 215 * <!-- begin-user-doc --> 216 * <!-- end-user-doc --> 217 * @generated 218 */ 219 public void setComment(String newComment) { 220 String oldComment = comment; 221 comment = newComment; 222 if (eNotificationRequired()) 223 eNotify(new ENotificationImpl(this, Notification.SET, ReviewPackage.WAIVER__COMMENT, oldComment, comment)); 224 } 225 226 /** 227 * <!-- begin-user-doc --> 228 * <!-- end-user-doc --> 229 * @generated 230 */ 231 @Override 232 public Object eGet(int featureID, boolean resolve, boolean coreType) { 233 switch (featureID) { 234 case ReviewPackage.WAIVER__SIGNATURE: 235 return getSignature(); 236 case ReviewPackage.WAIVER__INSPECTOR: 237 if (resolve) return getInspector(); 238 return basicGetInspector(); 239 case ReviewPackage.WAIVER__EXPIRATION_TIME: 240 return getExpirationTime(); 241 case ReviewPackage.WAIVER__COMMENT: 242 return getComment(); 243 } 244 return super.eGet(featureID, resolve, coreType); 245 } 246 247 /** 248 * <!-- begin-user-doc --> 249 * <!-- end-user-doc --> 250 * @generated 251 */ 252 @Override 253 public void eSet(int featureID, Object newValue) { 254 switch (featureID) { 255 case ReviewPackage.WAIVER__SIGNATURE: 256 setSignature((String)newValue); 257 return; 258 case ReviewPackage.WAIVER__INSPECTOR: 259 setInspector((Inspector)newValue); 260 return; 261 case ReviewPackage.WAIVER__EXPIRATION_TIME: 262 setExpirationTime((Long)newValue); 263 return; 264 case ReviewPackage.WAIVER__COMMENT: 265 setComment((String)newValue); 266 return; 267 } 268 super.eSet(featureID, newValue); 269 } 270 271 /** 272 * <!-- begin-user-doc --> 273 * <!-- end-user-doc --> 274 * @generated 275 */ 276 @Override 277 public void eUnset(int featureID) { 278 switch (featureID) { 279 case ReviewPackage.WAIVER__SIGNATURE: 280 setSignature(SIGNATURE_EDEFAULT); 281 return; 282 case ReviewPackage.WAIVER__INSPECTOR: 283 setInspector((Inspector)null); 284 return; 285 case ReviewPackage.WAIVER__EXPIRATION_TIME: 286 setExpirationTime(EXPIRATION_TIME_EDEFAULT); 287 return; 288 case ReviewPackage.WAIVER__COMMENT: 289 setComment(COMMENT_EDEFAULT); 290 return; 291 } 292 super.eUnset(featureID); 293 } 294 295 /** 296 * <!-- begin-user-doc --> 297 * <!-- end-user-doc --> 298 * @generated 299 */ 300 @Override 301 public boolean eIsSet(int featureID) { 302 switch (featureID) { 303 case ReviewPackage.WAIVER__SIGNATURE: 304 return SIGNATURE_EDEFAULT == null ? signature != null : !SIGNATURE_EDEFAULT.equals(signature); 305 case ReviewPackage.WAIVER__INSPECTOR: 306 return inspector != null; 307 case ReviewPackage.WAIVER__EXPIRATION_TIME: 308 return expirationTime != EXPIRATION_TIME_EDEFAULT; 309 case ReviewPackage.WAIVER__COMMENT: 310 return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); 311 } 312 return super.eIsSet(featureID); 313 } 314 315 /** 316 * <!-- begin-user-doc --> 317 * <!-- end-user-doc --> 318 * @generated 319 */ 320 @Override 321 public String toString() { 322 if (eIsProxy()) return super.toString(); 323 324 StringBuffer result = new StringBuffer(super.toString()); 325 result.append(" (signature: "); 326 result.append(signature); 327 result.append(", expirationTime: "); 328 result.append(expirationTime); 329 result.append(", comment: "); 330 result.append(comment); 331 result.append(')'); 332 return result.toString(); 333 } 334 335 } //WaiverImpl