| /** |
| * Copyright (c) 2019 CEA LIST, and others. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * CEA LIST - Initial API and implementation |
| */ |
| package org.eclipse.papyrus.gitlight.reviewprofile.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.gitlight.reviewprofile.ReviewComment; |
| import org.eclipse.papyrus.gitlight.reviewprofile.ReviewProfilePackage; |
| import org.eclipse.papyrus.gitlight.reviewprofile.ReviewSeverity; |
| |
| import org.eclipse.uml2.uml.Comment; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Review Comment</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.gitlight.reviewprofile.impl.ReviewCommentImpl#getBase_Comment <em>Base Comment</em>}</li> |
| * <li>{@link org.eclipse.papyrus.gitlight.reviewprofile.impl.ReviewCommentImpl#getSeverity <em>Severity</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ReviewCommentImpl extends MinimalEObjectImpl.Container implements ReviewComment { |
| /** |
| * The cached value of the '{@link #getBase_Comment() <em>Base Comment</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_Comment() |
| * @generated |
| * @ordered |
| */ |
| protected Comment base_Comment; |
| |
| /** |
| * The default value of the '{@link #getSeverity() <em>Severity</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSeverity() |
| * @generated |
| * @ordered |
| */ |
| protected static final ReviewSeverity SEVERITY_EDEFAULT = ReviewSeverity.INFO; |
| |
| /** |
| * The cached value of the '{@link #getSeverity() <em>Severity</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSeverity() |
| * @generated |
| * @ordered |
| */ |
| protected ReviewSeverity severity = SEVERITY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ReviewCommentImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReviewProfilePackage.Literals.REVIEW_COMMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Comment getBase_Comment() { |
| if (base_Comment != null && base_Comment.eIsProxy()) { |
| InternalEObject oldBase_Comment = (InternalEObject)base_Comment; |
| base_Comment = (Comment)eResolveProxy(oldBase_Comment); |
| if (base_Comment != oldBase_Comment) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT, oldBase_Comment, base_Comment)); |
| } |
| } |
| return base_Comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Comment basicGetBase_Comment() { |
| return base_Comment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBase_Comment(Comment newBase_Comment) { |
| Comment oldBase_Comment = base_Comment; |
| base_Comment = newBase_Comment; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT, oldBase_Comment, base_Comment)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ReviewSeverity getSeverity() { |
| return severity; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setSeverity(ReviewSeverity newSeverity) { |
| ReviewSeverity oldSeverity = severity; |
| severity = newSeverity == null ? SEVERITY_EDEFAULT : newSeverity; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReviewProfilePackage.REVIEW_COMMENT__SEVERITY, oldSeverity, severity)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT: |
| if (resolve) return getBase_Comment(); |
| return basicGetBase_Comment(); |
| case ReviewProfilePackage.REVIEW_COMMENT__SEVERITY: |
| return getSeverity(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT: |
| setBase_Comment((Comment)newValue); |
| return; |
| case ReviewProfilePackage.REVIEW_COMMENT__SEVERITY: |
| setSeverity((ReviewSeverity)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT: |
| setBase_Comment((Comment)null); |
| return; |
| case ReviewProfilePackage.REVIEW_COMMENT__SEVERITY: |
| setSeverity(SEVERITY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReviewProfilePackage.REVIEW_COMMENT__BASE_COMMENT: |
| return base_Comment != null; |
| case ReviewProfilePackage.REVIEW_COMMENT__SEVERITY: |
| return severity != SEVERITY_EDEFAULT; |
| } |
| 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(" (severity: "); //$NON-NLS-1$ |
| result.append(severity); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ReviewCommentImpl |