// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubSCMHead.java
// public abstract class GitHubSCMHead<T extends GitHubCause<T>> extends SCMHead {
//     private static final long serialVersionUID = 1L;
// 
//     private final String sourceId;
// 
//     public GitHubSCMHead(@NonNull String name, String sourceId) {
//         super(name);
//         this.sourceId = sourceId;
//     }
// 
//     public String getSourceId() {
//         return sourceId;
//     }
// 
//     public abstract String fetchHeadSha(GHRepository remoteRepo) throws IOException;
// 
//     public abstract String getHeadSha(T cause);
// 
//     public GitHubSCMRevision createSCMRevision(T cause) {
//         return new GitHubSCMRevision(this, getHeadSha(cause), cause);
//     }
// }


import com.github.kostyasha.github.integration.multibranch.head.GitHubSCMHead;
import com.github.kostyasha.github.integration.multibranch.revision.GitHubSCMRevision;
import hudson.model.Cause;
import hudson.model.ParameterValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.apache.commons.lang.StringUtils.abbreviate;
        return remoteData;
    }

    public GitHubCause<T> withRemoteData(Object remoteData) {
        this.remoteData = remoteData;
        return this;
    }

    /**
     * @return the title of the cause, never null.
     */
    @NonNull
    public String getTitle() {
        return nonNull(title) ? title : "";
    }

    public GitHubCause<T> withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * @return at most the first 30 characters of the title, or
     */
    public String getAbbreviatedTitle() {
        return abbreviate(getTitle(), 30);
    }

    public abstract void fillParameters(List<ParameterValue> params);

// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/head/GitHubSCMHead.java
// public abstract class GitHubSCMHead<T extends GitHubCause<T>> extends SCMHead {
//     private static final long serialVersionUID = 1L;
// 
//     private final String sourceId;
// 
//     public GitHubSCMHead(@NonNull String name, String sourceId) {
//         super(name);
//         this.sourceId = sourceId;
//     }
// 
//     public String getSourceId() {
//         return sourceId;
//     }
// 
//     public abstract String fetchHeadSha(GHRepository remoteRepo) throws IOException;
// 
//     public abstract String getHeadSha(T cause);
// 
//     public GitHubSCMRevision createSCMRevision(T cause) {
//         return new GitHubSCMRevision(this, getHeadSha(cause), cause);
//     }
// }


// Path: github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/generic/GitHubCause.java
import com.github.kostyasha.github.integration.multibranch.head.GitHubSCMHead;
import com.github.kostyasha.github.integration.multibranch.revision.GitHubSCMRevision;
import hudson.model.Cause;
import hudson.model.ParameterValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static org.apache.commons.io.FileUtils.readFileToString;
import static org.apache.commons.lang.StringUtils.abbreviate;

        return remoteData;
    }

    public GitHubCause<T> withRemoteData(Object remoteData) {
        this.remoteData = remoteData;
        return this;
    }

    /**
     * @return the title of the cause, never null.
     */
    @NonNull
    public String getTitle() {
        return nonNull(title) ? title : "";
    }

    public GitHubCause<T> withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * @return at most the first 30 characters of the title, or
     */
    public String getAbbreviatedTitle() {
        return abbreviate(getTitle(), 30);
    }

    public abstract void fillParameters(List<ParameterValue> params);

    public abstract GitHubSCMHead<T> createSCMHead(String sourceId);