diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-12-05 11:37:56 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-12-13 21:39:09 +0300 |
commit | 5fa1952a2e582f2c428584c5ccc1800132559df0 (patch) | |
tree | 7446f557a3bc5448fd48292a327eae7f0f3afa19 /src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java | |
parent | 92cf04a50b051cb6c96d0000eb8763797b239496 (diff) | |
download | bbprb-5fa1952a2e582f2c428584c5ccc1800132559df0.tar.gz |
Version 0.1.00.1.0
Diffstat (limited to 'src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java')
-rw-r--r-- | src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java new file mode 100644 index 0000000..a4a20a6 --- /dev/null +++ b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketCause.java @@ -0,0 +1,80 @@ +package org.jenkinsci.plugins.bbprb; + +import hudson.model.Cause; + +/** + * Created by nishio + */ +public class BitbucketCause extends Cause { + private final String sourceBranch; + private final String targetBranch; + private final String sourceRepository; + private final String pullRequestId; + private final String destinationRepository; + private final String pullRequestTitle; + private final String sourceCommitHash; + private final String destinationCommitHash; + private final String pullRequestAuthor; + public static final String BITBUCKET_URL = "https://bitbucket.org/"; + + public BitbucketCause(String sourceBranch, String targetBranch, + String sourceRepository, String pullRequestId, + String destinationRepository, String pullRequestTitle, + String sourceCommitHash, String destinationCommitHash, + String pullRequestAuthor) { + this.sourceBranch = sourceBranch; + this.targetBranch = targetBranch; + this.sourceRepository = sourceRepository; + this.pullRequestId = pullRequestId; + this.destinationRepository = destinationRepository; + this.pullRequestTitle = pullRequestTitle; + this.sourceCommitHash = sourceCommitHash; + this.destinationCommitHash = destinationCommitHash; + this.pullRequestAuthor = pullRequestAuthor; + } + + public String getSourceBranch() { + return sourceBranch; + } + public String getTargetBranch() { + return targetBranch; + } + + public String getSourceRepository() { + return sourceRepository; + } + + public String getPullRequestId() { + return pullRequestId; + } + + public String getDestinationRepository() { + return destinationRepository; + } + + public String getPullRequestTitle() { + return pullRequestTitle; + } + + public String getSourceCommitHash() { + return sourceCommitHash; + } + + public String getDestinationCommitHash() { + return destinationCommitHash; + } + + @Override + public String getShortDescription() { + String description = + "<a href=\"" + BITBUCKET_URL + this.getDestinationRepository(); + description += "/pull-request/" + this.getPullRequestId(); + description += "\">#" + this.getPullRequestId() + " " + + this.getPullRequestTitle() + "</a>"; + return description; + } + + public String getPullRequestAuthor() { + return this.pullRequestAuthor; + } +} |