// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubPRSCMHead.java
// public class GitHubPRSCMHead extends GitHubSCMHead<GitHubPRCause> {
//     private static final long serialVersionUID = 1L;
// 
//     private final int prNumber;
//     private final String targetBranch;
// 
//     public GitHubPRSCMHead(@NonNull GitHubPRCause prCause, String sourceId) {
//         this(prCause.getNumber(), prCause.getTargetBranch(), sourceId);
//     }
// 
//     public GitHubPRSCMHead(@NonNull Integer prNumber, @NonNull String targetBranch, String sourceId) {
//         super("pr-" + Integer.toString(prNumber), sourceId);
//         this.prNumber = prNumber;
//         this.targetBranch = targetBranch;
//     }
// 
//     public int getPrNumber() {
//         return prNumber;
//     }
// 
//     public String getTargetBranch() {
//         return targetBranch;
//     }
// 
//     @Override
//     public String getPronoun() {
//         return "PR#" + prNumber;
//     }
// 
//     @Override
//     public String fetchHeadSha(GHRepository remoteRepo) throws IOException {
//         GHPullRequest pullRequest = remoteRepo.getPullRequest(prNumber);
//         if (pullRequest == null) {
//             throw new IOException("No PR " + prNumber + " in " + remoteRepo.getFullName());
//         }
//         return pullRequest.getHead().getSha();
//     }
// 
//     @Override
//     public String getHeadSha(GitHubPRCause cause) {
//         return cause.getHeadSha();
//     }
// }


import com.github.kostyasha.github.integration.multibranch.head.GitHubPRSCMHead;
import jenkins.scm.api.SCMHead;
import jenkins.util.NonLocalizable;
import org.jvnet.localizer.Localizable;
import edu.umd.cs.findbugs.annotations.NonNull;
package com.github.kostyasha.github.integration.multibranch.category;



public class GitHubPRSCMHeadCategory extends GitHubSCMHeadCategory {
    public static final GitHubPRSCMHeadCategory PR = new GitHubPRSCMHeadCategory("pr", new NonLocalizable("Pull Requests"));

    public GitHubPRSCMHeadCategory(@NonNull String urlName, Localizable pronoun) {
        super(urlName, pronoun);
    }

    @Override
    public boolean isMatch(@NonNull SCMHead instance) {
// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubPRSCMHead.java
// public class GitHubPRSCMHead extends GitHubSCMHead<GitHubPRCause> {
//     private static final long serialVersionUID = 1L;
// 
//     private final int prNumber;
//     private final String targetBranch;
// 
//     public GitHubPRSCMHead(@NonNull GitHubPRCause prCause, String sourceId) {
//         this(prCause.getNumber(), prCause.getTargetBranch(), sourceId);
//     }
// 
//     public GitHubPRSCMHead(@NonNull Integer prNumber, @NonNull String targetBranch, String sourceId) {
//         super("pr-" + Integer.toString(prNumber), sourceId);
//         this.prNumber = prNumber;
//         this.targetBranch = targetBranch;
//     }
// 
//     public int getPrNumber() {
//         return prNumber;
//     }
// 
//     public String getTargetBranch() {
//         return targetBranch;
//     }
// 
//     @Override
//     public String getPronoun() {
//         return "PR#" + prNumber;
//     }
// 
//     @Override
//     public String fetchHeadSha(GHRepository remoteRepo) throws IOException {
//         GHPullRequest pullRequest = remoteRepo.getPullRequest(prNumber);
//         if (pullRequest == null) {
//             throw new IOException("No PR " + prNumber + " in " + remoteRepo.getFullName());
//         }
//         return pullRequest.getHead().getSha();
//     }
// 
//     @Override
//     public String getHeadSha(GitHubPRCause cause) {
//         return cause.getHeadSha();
//     }
// }


// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/category/GitHubPRSCMHeadCategory.java
import com.github.kostyasha.github.integration.multibranch.head.GitHubPRSCMHead;
import jenkins.scm.api.SCMHead;
import jenkins.util.NonLocalizable;
import org.jvnet.localizer.Localizable;
import edu.umd.cs.findbugs.annotations.NonNull;

package com.github.kostyasha.github.integration.multibranch.category;



public class GitHubPRSCMHeadCategory extends GitHubSCMHeadCategory {
    public static final GitHubPRSCMHeadCategory PR = new GitHubPRSCMHeadCategory("pr", new NonLocalizable("Pull Requests"));

    public GitHubPRSCMHeadCategory(@NonNull String urlName, Localizable pronoun) {
        super(urlName, pronoun);
    }

    @Override
    public boolean isMatch(@NonNull SCMHead instance) {
        return instance instanceof GitHubPRSCMHead;