mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 08:21:21 +00:00
Further restoration of the compatibility
This commit is contained in:
@@ -23,10 +23,13 @@
|
||||
*/
|
||||
package org.kohsuke.github;
|
||||
|
||||
import javax.annotation.CheckForNull;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A pull request.
|
||||
@@ -307,6 +310,28 @@ public class GHPullRequest extends GHIssue {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use {@link #createReview()}
|
||||
*/
|
||||
public GHPullRequestReview createReview(String body, @CheckForNull GHPullRequestReviewState event,
|
||||
GHPullRequestReviewComment... comments) throws IOException {
|
||||
return createReview(body, event, Arrays.asList(comments));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Use {@link #createReview()}
|
||||
*/
|
||||
public GHPullRequestReview createReview(String body, @CheckForNull GHPullRequestReviewState event,
|
||||
List<GHPullRequestReviewComment> comments) throws IOException {
|
||||
GHPullRequestReviewBuilder b = createReview().body(body);
|
||||
for (GHPullRequestReviewComment c : comments) {
|
||||
b.comment(c.getBody(), c.getPath(), c.getPosition());
|
||||
}
|
||||
return b.create();
|
||||
}
|
||||
|
||||
public GHPullRequestReviewBuilder createReview() {
|
||||
return new GHPullRequestReviewBuilder(this);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,10 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
|
||||
private long in_reply_to_id = -1L;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* You should be using {@link GHPullRequestReviewBuilder#comment(String, String, int)}
|
||||
*/
|
||||
public static GHPullRequestReviewComment draft(String body, String path, int position) {
|
||||
GHPullRequestReviewComment result = new GHPullRequestReviewComment();
|
||||
result.body = body;
|
||||
@@ -86,18 +90,17 @@ public class GHPullRequestReviewComment extends GHObject implements Reactable {
|
||||
}
|
||||
|
||||
@CheckForNull
|
||||
public Integer getPosition() {
|
||||
return position == -1 ? null : position;
|
||||
public int getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
public int getOriginalPosition() {
|
||||
return original_position;
|
||||
}
|
||||
|
||||
@CheckForNull
|
||||
public Integer getOriginalPosition() {
|
||||
return original_position == -1 ? null : original_position;
|
||||
}
|
||||
|
||||
@CheckForNull
|
||||
public Long getInReplyToId() {
|
||||
return in_reply_to_id == -1 ? null : in_reply_to_id;
|
||||
public long getInReplyToId() {
|
||||
return in_reply_to_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user