summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Parker2012-09-20 20:41:31 (EDT)
committerMiles Parker2012-09-21 14:49:30 (EDT)
commite494e0633495be1a8679558c464dfcfb7faf2990 (patch)
tree6f3e34414f909d8a44a17fcd4bdf0f6cea59bfcf
parentf589c2a90b75a54f536f9c3e021a50e89a8d506d (diff)
downloadorg.eclipse.mylyn.reviews-e494e0633495be1a8679558c464dfcfb7faf2990.zip
org.eclipse.mylyn.reviews-e494e0633495be1a8679558c464dfcfb7faf2990.tar.gz
org.eclipse.mylyn.reviews-e494e0633495be1a8679558c464dfcfb7faf2990.tar.bz2
324327: Define a common model for reviewsrefs/changes/64/7864/2
Change-Id: I0649b44d881e273359ae067ccd69cc659a639d2f Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=324327
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IUser.java25
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java41
-rw-r--r--org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/User.java54
3 files changed, 117 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IUser.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IUser.java
index 403048d..daa577a 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IUser.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/core/model/IUser.java
@@ -19,6 +19,7 @@ package org.eclipse.mylyn.reviews.core.model;
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IUser#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.core.model.IUser#getEmail <em>Email</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.core.model.IUser#getDisplayName <em>Display Name</em>}</li>
* </ul>
* </p>
@@ -51,6 +52,30 @@ public interface IUser {
void setId(String value);
/**
+ * Returns the value of the '<em><b>Email</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Email</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Email</em>' attribute.
+ * @see #setEmail(String)
+ * @generated
+ */
+ String getEmail();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.mylyn.reviews.core.model.IUser#getEmail <em>Email</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Email</em>' attribute.
+ * @see #getEmail()
+ * @generated
+ */
+ void setEmail(String value);
+
+ /**
* Returns the value of the '<em><b>Display Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
index 8a28d8a..a9faa0c 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/ReviewsPackage.java
@@ -388,13 +388,22 @@ public class ReviewsPackage extends EPackageImpl {
public static final int USER__ID = 0;
/**
+ * The feature id for the '<em><b>Email</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int USER__EMAIL = 1;
+
+ /**
* The feature id for the '<em><b>Display Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int USER__DISPLAY_NAME = 1;
+ public static final int USER__DISPLAY_NAME = 2;
/**
* The number of structural features of the '<em>User</em>' class.
@@ -403,7 +412,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
* @ordered
*/
- public static final int USER_FEATURE_COUNT = 2;
+ public static final int USER_FEATURE_COUNT = 3;
/**
* The meta object id for the '{@link org.eclipse.mylyn.reviews.internal.core.model.TaskReference <em>Task Reference</em>}' class.
@@ -1515,6 +1524,19 @@ public class ReviewsPackage extends EPackageImpl {
}
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IUser#getEmail <em>Email</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Email</em>'.
+ * @see org.eclipse.mylyn.reviews.core.model.IUser#getEmail()
+ * @see #getUser()
+ * @generated
+ */
+ public EAttribute getUser_Email() {
+ return (EAttribute) userEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
* Returns the meta object for the attribute '{@link org.eclipse.mylyn.reviews.core.model.IUser#getDisplayName <em>Display Name</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1524,7 +1546,7 @@ public class ReviewsPackage extends EPackageImpl {
* @generated
*/
public EAttribute getUser_DisplayName() {
- return (EAttribute) userEClass.getEStructuralFeatures().get(1);
+ return (EAttribute) userEClass.getEStructuralFeatures().get(2);
}
/**
@@ -2003,6 +2025,7 @@ public class ReviewsPackage extends EPackageImpl {
userEClass = createEClass(USER);
createEAttribute(userEClass, USER__ID);
+ createEAttribute(userEClass, USER__EMAIL);
createEAttribute(userEClass, USER__DISPLAY_NAME);
taskReferenceEClass = createEClass(TASK_REFERENCE);
@@ -2185,6 +2208,10 @@ public class ReviewsPackage extends EPackageImpl {
ecorePackage.getEString(),
"id", null, 0, 1, IUser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
initEAttribute(
+ getUser_Email(),
+ ecorePackage.getEString(),
+ "email", null, 0, 1, IUser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
+ initEAttribute(
getUser_DisplayName(),
ecorePackage.getEString(),
"displayName", null, 0, 1, IUser.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$
@@ -2550,6 +2577,14 @@ public class ReviewsPackage extends EPackageImpl {
public static final EAttribute USER__ID = eINSTANCE.getUser_Id();
/**
+ * The meta object literal for the '<em><b>Email</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute USER__EMAIL = eINSTANCE.getUser_Email();
+
+ /**
* The meta object literal for the '<em><b>Display Name</b></em>' attribute feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/User.java b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/User.java
index fdbfc56..8d75be8 100644
--- a/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/User.java
+++ b/org.eclipse.mylyn.reviews.core/src/org/eclipse/mylyn/reviews/internal/core/model/User.java
@@ -27,6 +27,7 @@ import org.eclipse.mylyn.reviews.core.model.IUser;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.User#getId <em>Id</em>}</li>
+ * <li>{@link org.eclipse.mylyn.reviews.internal.core.model.User#getEmail <em>Email</em>}</li>
* <li>{@link org.eclipse.mylyn.reviews.internal.core.model.User#getDisplayName <em>Display Name</em>}</li>
* </ul>
* </p>
@@ -55,6 +56,26 @@ public class User extends EObjectImpl implements IUser {
protected String id = ID_EDEFAULT;
/**
+ * The default value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected static final String EMAIL_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getEmail() <em>Email</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEmail()
+ * @generated
+ * @ordered
+ */
+ protected String email = EMAIL_EDEFAULT;
+
+ /**
* The default value of the '{@link #getDisplayName() <em>Display Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -119,6 +140,27 @@ public class User extends EObjectImpl implements IUser {
* <!-- end-user-doc -->
* @generated
*/
+ public String getEmail() {
+ return email;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setEmail(String newEmail) {
+ String oldEmail = email;
+ email = newEmail;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ReviewsPackage.USER__EMAIL, oldEmail, email));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public String getDisplayName() {
return displayName;
}
@@ -146,6 +188,8 @@ public class User extends EObjectImpl implements IUser {
switch (featureID) {
case ReviewsPackage.USER__ID:
return getId();
+ case ReviewsPackage.USER__EMAIL:
+ return getEmail();
case ReviewsPackage.USER__DISPLAY_NAME:
return getDisplayName();
}
@@ -163,6 +207,9 @@ public class User extends EObjectImpl implements IUser {
case ReviewsPackage.USER__ID:
setId((String) newValue);
return;
+ case ReviewsPackage.USER__EMAIL:
+ setEmail((String) newValue);
+ return;
case ReviewsPackage.USER__DISPLAY_NAME:
setDisplayName((String) newValue);
return;
@@ -181,6 +228,9 @@ public class User extends EObjectImpl implements IUser {
case ReviewsPackage.USER__ID:
setId(ID_EDEFAULT);
return;
+ case ReviewsPackage.USER__EMAIL:
+ setEmail(EMAIL_EDEFAULT);
+ return;
case ReviewsPackage.USER__DISPLAY_NAME:
setDisplayName(DISPLAY_NAME_EDEFAULT);
return;
@@ -198,6 +248,8 @@ public class User extends EObjectImpl implements IUser {
switch (featureID) {
case ReviewsPackage.USER__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
+ case ReviewsPackage.USER__EMAIL:
+ return EMAIL_EDEFAULT == null ? email != null : !EMAIL_EDEFAULT.equals(email);
case ReviewsPackage.USER__DISPLAY_NAME:
return DISPLAY_NAME_EDEFAULT == null ? displayName != null : !DISPLAY_NAME_EDEFAULT.equals(displayName);
}
@@ -217,6 +269,8 @@ public class User extends EObjectImpl implements IUser {
StringBuffer result = new StringBuffer(super.toString());
result.append(" (id: "); //$NON-NLS-1$
result.append(id);
+ result.append(", email: "); //$NON-NLS-1$
+ result.append(email);
result.append(", displayName: "); //$NON-NLS-1$
result.append(displayName);
result.append(')');