aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java
diff options
context:
space:
mode:
authorS.nishio <nishio@densan-labs.net>2014-02-09 01:44:43 +0900
committerS.nishio <nishio@densan-labs.net>2014-02-12 21:53:08 +0900
commit49ffd99bfcdc19ba3ada480aa3cf4bd6879d2d45 (patch)
tree4280b3e868540172f3561122cff9bc2207e92856 /src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java
downloadbbprb-49ffd99bfcdc19ba3ada480aa3cf4bd6879d2d45.tar.gz
initial commit
Diffstat (limited to 'src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java
new file mode 100644
index 0000000..1cb5da4
--- /dev/null
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketCause.java
@@ -0,0 +1,76 @@
+package bitbucketpullrequestbuilder.bitbucketpullrequestbuilder;
+
+import hudson.model.Cause;
+
+/**
+ * Created by nishio
+ */
+public class BitbucketCause extends Cause {
+ private final String sourceBranch;
+ private final String targetBranch;
+ private final String repositoryOwner;
+ private final String repositoryName;
+ private final String pullRequestId;
+ private final String destinationRepositoryOwner;
+ private final String destinationRepositoryName;
+ private final String pullRequestTitle;
+ public static final String BITBUCKET_URL = "https://bitbucket.org/";
+
+ public BitbucketCause(String sourceBranch,
+ String targetBranch,
+ String repositoryOwner,
+ String repositoryName,
+ String pullRequestId,
+ String destinationRepositoryOwner,
+ String destinationRepositoryName,
+ String pullRequestTitle) {
+ this.sourceBranch = sourceBranch;
+ this.targetBranch = targetBranch;
+ this.repositoryOwner = repositoryOwner;
+ this.repositoryName = repositoryName;
+ this.pullRequestId = pullRequestId;
+ this.destinationRepositoryOwner = destinationRepositoryOwner;
+ this.destinationRepositoryName = destinationRepositoryName;
+ this.pullRequestTitle = pullRequestTitle;
+ }
+
+ public String getSourceBranch() {
+ return sourceBranch;
+ }
+ public String getTargetBranch() {
+ return targetBranch;
+ }
+
+ public String getRepositoryOwner() {
+ return repositoryOwner;
+ }
+
+ public String getRepositoryName() {
+ return repositoryName;
+ }
+
+ public String getPullRequestId() {
+ return pullRequestId;
+ }
+
+
+ public String getDestinationRepositoryOwner() {
+ return destinationRepositoryOwner;
+ }
+
+ public String getDestinationRepositoryName() {
+ return destinationRepositoryName;
+ }
+
+ public String getPullRequestTitle() {
+ return pullRequestTitle;
+ }
+
+ @Override
+ public String getShortDescription() {
+ String description = "<a href=" + BITBUCKET_URL + this.getDestinationRepositoryOwner() + "/";
+ description += this.getDestinationRepositoryName() + "/pull-request/" + this.getPullRequestId();
+ description += ">#" + this.getPullRequestId() + " " + this.getPullRequestTitle() + "</a>";
+ return description;
+ }
+}