Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-04-06 00:05:57 +0000
committerKevin Sawicki2012-04-06 00:05:57 +0000
commit01c1c97687a59883c98932e239997ca614e26545 (patch)
tree3ffce797697adb82fcecf12185c2edfef87806fd /org.eclipse.egit.github.core/src
parent6bcc10b1dd2c86626b242e286596ec9424d7f8f1 (diff)
downloadegit-github-01c1c97687a59883c98932e239997ca614e26545.tar.gz
egit-github-01c1c97687a59883c98932e239997ca614e26545.tar.xz
egit-github-01c1c97687a59883c98932e239997ca614e26545.zip
Add support for PullRequestReviewCommentEvent type
Diffstat (limited to 'org.eclipse.egit.github.core/src')
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/EventFormatter.java4
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/Event.java5
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java42
3 files changed, 51 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/EventFormatter.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/EventFormatter.java
index 94b12a0e..daad25d5 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/EventFormatter.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/client/EventFormatter.java
@@ -24,6 +24,7 @@ import static org.eclipse.egit.github.core.event.Event.TYPE_ISSUE_COMMENT;
import static org.eclipse.egit.github.core.event.Event.TYPE_MEMBER;
import static org.eclipse.egit.github.core.event.Event.TYPE_PUBLIC;
import static org.eclipse.egit.github.core.event.Event.TYPE_PULL_REQUEST;
+import static org.eclipse.egit.github.core.event.Event.TYPE_PULL_REQUEST_REVIEW_COMMENT;
import static org.eclipse.egit.github.core.event.Event.TYPE_PUSH;
import static org.eclipse.egit.github.core.event.Event.TYPE_TEAM_ADD;
import static org.eclipse.egit.github.core.event.Event.TYPE_WATCH;
@@ -52,6 +53,7 @@ import org.eclipse.egit.github.core.event.IssuesPayload;
import org.eclipse.egit.github.core.event.MemberPayload;
import org.eclipse.egit.github.core.event.PublicPayload;
import org.eclipse.egit.github.core.event.PullRequestPayload;
+import org.eclipse.egit.github.core.event.PullRequestReviewCommentPayload;
import org.eclipse.egit.github.core.event.PushPayload;
import org.eclipse.egit.github.core.event.TeamAddPayload;
import org.eclipse.egit.github.core.event.WatchPayload;
@@ -96,6 +98,8 @@ public class EventFormatter {
clazz = PublicPayload.class;
else if (TYPE_PULL_REQUEST.equals(type))
clazz = PullRequestPayload.class;
+ else if (TYPE_PULL_REQUEST_REVIEW_COMMENT.equals(type))
+ clazz = PullRequestReviewCommentPayload.class;
else if (TYPE_PUSH.equals(type))
clazz = PushPayload.class;
else if (TYPE_TEAM_ADD.equals(type))
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/Event.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/Event.java
index 1b24a12d..4883e909 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/Event.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/Event.java
@@ -94,6 +94,11 @@ public class Event implements Serializable {
public static final String TYPE_PULL_REQUEST = "PullRequestEvent";
/**
+ * Event type denoting a {@link PullRequestReviewCommentPayload}
+ */
+ public static final String TYPE_PULL_REQUEST_REVIEW_COMMENT = "PullRequestReviewCommentEvent";
+
+ /**
* Event type denoting a {@link PushPayload}
*/
public static final String TYPE_PUSH = "PushEvent";
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java
new file mode 100644
index 00000000..04f6d8a0
--- /dev/null
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * Copyright (c) 2012 GitHub Inc.
+ * 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:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *****************************************************************************/
+package org.eclipse.egit.github.core.event;
+
+import java.io.Serializable;
+
+import org.eclipse.egit.github.core.CommitComment;
+
+/**
+ * Payload for an event with type {@link Event#TYPE_PULL_REQUEST_REVIEW_COMMENT}
+ */
+public class PullRequestReviewCommentPayload extends EventPayload implements
+ Serializable {
+
+ private static final long serialVersionUID = -2403658752886394741L;
+
+ private CommitComment comment;
+
+ /**
+ * @return comment
+ */
+ public CommitComment getComment() {
+ return comment;
+ }
+
+ /**
+ * @param comment
+ * @return this payload
+ */
+ public PullRequestReviewCommentPayload setComment(CommitComment comment) {
+ this.comment = comment;
+ return this;
+ }
+}

Back to the top