Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Ander Peñalba2015-03-07 15:12:31 -0500
committerJon Ander Peñalba2015-03-23 19:08:07 -0400
commit83ded1ee671f81db553d1827a5136d0c072056e1 (patch)
treea6ad0e3a3f312837910b9c687c027e9034ac2888
parentf131288973836f2ff3baa8c48d414c92f824d76c (diff)
downloadegit-github-83ded1ee671f81db553d1827a5136d0c072056e1.tar.gz
egit-github-83ded1ee671f81db553d1827a5136d0c072056e1.tar.xz
egit-github-83ded1ee671f81db553d1827a5136d0c072056e1.zip
Added `rename` field to the IssueEvent class
Change-Id: I83312c06fe5b0a51a673258436e3710acb964636 Signed-off-by: Jon Ander Peñalba <jonan88@gmail.com>
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java4
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/IssueEvent.java18
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Rename.java59
3 files changed, 81 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
index 4068b07e..e9fdafb8 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueEventTest.java
@@ -20,6 +20,7 @@ import org.eclipse.egit.github.core.Issue;
import org.eclipse.egit.github.core.IssueEvent;
import org.eclipse.egit.github.core.Label;
import org.eclipse.egit.github.core.Milestone;
+import org.eclipse.egit.github.core.Rename;
import org.eclipse.egit.github.core.User;
import org.junit.Test;
@@ -43,6 +44,7 @@ public class IssueEventTest {
assertNull(event.getLabel());
assertNull(event.getAssignee());
assertNull(event.getMilestone());
+ assertNull(event.getRename());
assertNull(event.getIssue());
}
@@ -66,6 +68,8 @@ public class IssueEventTest {
assertEquals(assignee, event.setAssignee(assignee).getAssignee());
Milestone milestone = new Milestone().setTitle("Milestone");
assertEquals(milestone, event.setMilestone(milestone).getMilestone());
+ Rename rename = new Rename().setFrom("from").setTo("to");
+ assertEquals(rename, event.setRename(rename).getRename());
Issue issue = new Issue().setNumber(30);
assertEquals(issue, event.setIssue(issue).getIssue());
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/IssueEvent.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/IssueEvent.java
index a1e63312..c2cd6d50 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/IssueEvent.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/IssueEvent.java
@@ -126,6 +126,8 @@ public class IssueEvent implements Serializable {
private Milestone milestone;
+ private Rename rename;
+
private Issue issue;
/**
@@ -273,6 +275,22 @@ public class IssueEvent implements Serializable {
}
/**
+ * @return rename
+ */
+ public Rename getRename() {
+ return rename;
+ }
+
+ /**
+ * @param rename
+ * @return this issue event
+ */
+ public IssueEvent setRename(Rename rename) {
+ this.rename = rename;
+ return this;
+ }
+
+ /**
* @return issue
*/
public Issue getIssue() {
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Rename.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Rename.java
new file mode 100644
index 00000000..80110205
--- /dev/null
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Rename.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Jon Ander Peñalba <jonan88@gmail.com>.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Jon Ander Peñalba - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.egit.github.core;
+
+import java.io.ObjectStreamClass;
+import java.io.Serializable;
+
+/**
+ * Rename model class
+ */
+public class Rename implements Serializable {
+
+ /** serialVersionUID */;
+ private final static long serialVersionUID = -4700399891066053425L;
+
+ private String from;
+
+ private String to;
+
+ /**
+ * @return from
+ */
+ public String getFrom() {
+ return from;
+ }
+
+ /**
+ * @param from
+ * @return this rename model
+ */
+ public Rename setFrom(String from) {
+ this.from = from;
+ return this;
+ }
+
+ /**
+ * @return to
+ */
+ public String getTo() {
+ return to;
+ }
+
+ /**
+ * @param to
+ * @return this rename model
+ */
+ public Rename setTo(String to) {
+ this.to = to;
+ return this;
+ }
+}

Back to the top