| /******************************************************************************* |
| * Copyright (c) 2009, 2019 Xored Software Inc and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.reporting.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| import org.eclipse.emf.common.util.EList; |
| 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.EObjectImpl; |
| import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; |
| import org.eclipse.rcptt.ecl.core.ProcessStatus; |
| import org.eclipse.rcptt.reporting.ItemKind; |
| import org.eclipse.rcptt.reporting.Q7Info; |
| import org.eclipse.rcptt.reporting.ReportingPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Q7 Info</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getType <em>Type</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getLine <em>Line</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getTags <em>Tags</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getSubtype <em>Subtype</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getVariant <em>Variant</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getPhase <em>Phase</em>}</li> |
| * <li>{@link org.eclipse.rcptt.reporting.impl.Q7InfoImpl#getResult <em>Result</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class Q7InfoImpl extends EObjectImpl implements Q7Info { |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected static final ItemKind TYPE_EDEFAULT = ItemKind.CONTEXT; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected ItemKind type = TYPE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected static final int LINE_EDEFAULT = 0; |
| |
| /** |
| * The cached value of the '{@link #getLine() <em>Line</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLine() |
| * @generated |
| * @ordered |
| */ |
| protected int line = LINE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getTags() <em>Tags</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTags() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TAGS_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTags() <em>Tags</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTags() |
| * @generated |
| * @ordered |
| */ |
| protected String tags = TAGS_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected String description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getSubtype() <em>Subtype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSubtype() |
| * @generated |
| * @ordered |
| */ |
| protected static final String SUBTYPE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getSubtype() <em>Subtype</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getSubtype() |
| * @generated |
| * @ordered |
| */ |
| protected String subtype = SUBTYPE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getVariant() <em>Variant</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getVariant() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> variant; |
| |
| /** |
| * The default value of the '{@link #getPhase() <em>Phase</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPhase() |
| * @generated |
| * @ordered |
| */ |
| protected static final String PHASE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getPhase() <em>Phase</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPhase() |
| * @generated |
| * @ordered |
| */ |
| protected String phase = PHASE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getResult() <em>Result</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getResult() |
| * @generated |
| * @ordered |
| */ |
| protected ProcessStatus result; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected Q7InfoImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReportingPackage.Literals.Q7_INFO; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ItemKind getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setType(ItemKind newType) { |
| ItemKind oldType = type; |
| type = newType == null ? TYPE_EDEFAULT : newType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__TYPE, oldType, type)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ProcessStatus getResult() { |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetResult(ProcessStatus newResult, NotificationChain msgs) { |
| ProcessStatus oldResult = result; |
| result = newResult; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__RESULT, oldResult, newResult); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setResult(ProcessStatus newResult) { |
| if (newResult != result) { |
| NotificationChain msgs = null; |
| if (result != null) |
| msgs = ((InternalEObject)result).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ReportingPackage.Q7_INFO__RESULT, null, msgs); |
| if (newResult != null) |
| msgs = ((InternalEObject)newResult).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ReportingPackage.Q7_INFO__RESULT, null, msgs); |
| msgs = basicSetResult(newResult, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__RESULT, newResult, newResult)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ReportingPackage.Q7_INFO__RESULT: |
| return basicSetResult(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public int getLine() { |
| return line; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLine(int newLine) { |
| int oldLine = line; |
| line = newLine; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__LINE, oldLine, line)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTags() { |
| return tags; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTags(String newTags) { |
| String oldTags = tags; |
| tags = newTags; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__TAGS, oldTags, tags)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(String newDescription) { |
| String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getSubtype() { |
| return subtype; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setSubtype(String newSubtype) { |
| String oldSubtype = subtype; |
| subtype = newSubtype; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__SUBTYPE, oldSubtype, subtype)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<String> getVariant() { |
| if (variant == null) { |
| variant = new EDataTypeUniqueEList<String>(String.class, this, ReportingPackage.Q7_INFO__VARIANT); |
| } |
| return variant; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getPhase() { |
| return phase; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPhase(String newPhase) { |
| String oldPhase = phase; |
| phase = newPhase; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReportingPackage.Q7_INFO__PHASE, oldPhase, phase)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ReportingPackage.Q7_INFO__ID: |
| return getId(); |
| case ReportingPackage.Q7_INFO__TYPE: |
| return getType(); |
| case ReportingPackage.Q7_INFO__LINE: |
| return getLine(); |
| case ReportingPackage.Q7_INFO__TAGS: |
| return getTags(); |
| case ReportingPackage.Q7_INFO__DESCRIPTION: |
| return getDescription(); |
| case ReportingPackage.Q7_INFO__SUBTYPE: |
| return getSubtype(); |
| case ReportingPackage.Q7_INFO__VARIANT: |
| return getVariant(); |
| case ReportingPackage.Q7_INFO__PHASE: |
| return getPhase(); |
| case ReportingPackage.Q7_INFO__RESULT: |
| return getResult(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ReportingPackage.Q7_INFO__ID: |
| setId((String)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__TYPE: |
| setType((ItemKind)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__LINE: |
| setLine((Integer)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__TAGS: |
| setTags((String)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__DESCRIPTION: |
| setDescription((String)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__SUBTYPE: |
| setSubtype((String)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__VARIANT: |
| getVariant().clear(); |
| getVariant().addAll((Collection<? extends String>)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__PHASE: |
| setPhase((String)newValue); |
| return; |
| case ReportingPackage.Q7_INFO__RESULT: |
| setResult((ProcessStatus)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReportingPackage.Q7_INFO__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__LINE: |
| setLine(LINE_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__TAGS: |
| setTags(TAGS_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__SUBTYPE: |
| setSubtype(SUBTYPE_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__VARIANT: |
| getVariant().clear(); |
| return; |
| case ReportingPackage.Q7_INFO__PHASE: |
| setPhase(PHASE_EDEFAULT); |
| return; |
| case ReportingPackage.Q7_INFO__RESULT: |
| setResult((ProcessStatus)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReportingPackage.Q7_INFO__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case ReportingPackage.Q7_INFO__TYPE: |
| return type != TYPE_EDEFAULT; |
| case ReportingPackage.Q7_INFO__LINE: |
| return line != LINE_EDEFAULT; |
| case ReportingPackage.Q7_INFO__TAGS: |
| return TAGS_EDEFAULT == null ? tags != null : !TAGS_EDEFAULT.equals(tags); |
| case ReportingPackage.Q7_INFO__DESCRIPTION: |
| return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); |
| case ReportingPackage.Q7_INFO__SUBTYPE: |
| return SUBTYPE_EDEFAULT == null ? subtype != null : !SUBTYPE_EDEFAULT.equals(subtype); |
| case ReportingPackage.Q7_INFO__VARIANT: |
| return variant != null && !variant.isEmpty(); |
| case ReportingPackage.Q7_INFO__PHASE: |
| return PHASE_EDEFAULT == null ? phase != null : !PHASE_EDEFAULT.equals(phase); |
| case ReportingPackage.Q7_INFO__RESULT: |
| return result != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (id: "); |
| result.append(id); |
| result.append(", type: "); |
| result.append(type); |
| result.append(", line: "); |
| result.append(line); |
| result.append(", tags: "); |
| result.append(tags); |
| result.append(", description: "); |
| result.append(description); |
| result.append(", subtype: "); |
| result.append(subtype); |
| result.append(", variant: "); |
| result.append(variant); |
| result.append(", phase: "); |
| result.append(phase); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //Q7InfoImpl |