Files
github-api/jacoco/org.kohsuke.github/GHRepositoryBuilder.java.html
2021-06-02 11:09:28 -07:00

253 lines
9.0 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>GHRepositoryBuilder.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">GitHub API for Java</a> &gt; <a href="index.source.html" class="el_package">org.kohsuke.github</a> &gt; <span class="el_source">GHRepositoryBuilder.java</span></div><h1>GHRepositoryBuilder.java</h1><pre class="source lang-java linenums">package org.kohsuke.github;
import org.kohsuke.github.GHRepository.Visibility;
import java.io.IOException;
import java.net.URL;
import static org.kohsuke.github.internal.Previews.BAPTISTE;
import static org.kohsuke.github.internal.Previews.NEBULA;
abstract class GHRepositoryBuilder&lt;S&gt; extends AbstractBuilder&lt;GHRepository, S&gt; {
protected GHRepositoryBuilder(Class&lt;S&gt; intermediateReturnType, GitHub root, GHRepository baseInstance) {
<span class="fc" id="L14"> super(GHRepository.class, intermediateReturnType, root, baseInstance);</span>
<span class="fc" id="L15"> }</span>
/**
* Allow or disallow squash-merging pull requests.
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S allowSquashMerge(boolean enabled) throws IOException {
<span class="fc" id="L29"> return with(&quot;allow_squash_merge&quot;, enabled);</span>
}
/**
* Allow or disallow merging pull requests with a merge commit.
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S allowMergeCommit(boolean enabled) throws IOException {
<span class="fc" id="L44"> return with(&quot;allow_merge_commit&quot;, enabled);</span>
}
/**
* Allow or disallow rebase-merging pull requests.
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S allowRebaseMerge(boolean enabled) throws IOException {
<span class="fc" id="L59"> return with(&quot;allow_rebase_merge&quot;, enabled);</span>
}
/**
* After pull requests are merged, you can have head branches deleted automatically.
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S deleteBranchOnMerge(boolean enabled) throws IOException {
<span class="fc" id="L74"> return with(&quot;delete_branch_on_merge&quot;, enabled);</span>
}
/**
* Default repository branch
*
* @param branch
* branch name
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S defaultBranch(String branch) throws IOException {
<span class="nc" id="L89"> return with(&quot;default_branch&quot;, branch);</span>
}
/**
* Description for repository
*
* @param description
* description of repository
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S description(String description) throws IOException {
<span class="fc" id="L104"> return with(&quot;description&quot;, description);</span>
}
/**
* Homepage for repository
*
* @param homepage
* homepage of repository
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S homepage(URL homepage) throws IOException {
<span class="nc" id="L119"> return homepage(homepage.toExternalForm());</span>
}
/**
* Homepage for repository
*
* @param homepage
* homepage of repository
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S homepage(String homepage) throws IOException {
<span class="fc" id="L134"> return with(&quot;homepage&quot;, homepage);</span>
}
/**
* Sets the repository to private
*
* @param enabled
* private if true
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S private_(boolean enabled) throws IOException {
<span class="fc" id="L149"> return with(&quot;private&quot;, enabled);</span>
}
/**
* Sets the repository visibility
*
* @param visibility
* visibility of repository
* @return a builder to continue with building
* @throws IOException
* In case of any networking error or error from the server.
*/
public S visibility(final Visibility visibility) throws IOException {
<span class="nc" id="L162"> requester.withPreview(NEBULA);</span>
<span class="nc" id="L163"> return with(&quot;visibility&quot;, visibility);</span>
}
/**
* Enables issue tracker
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S issues(boolean enabled) throws IOException {
<span class="fc" id="L178"> return with(&quot;has_issues&quot;, enabled);</span>
}
/**
* Enables projects
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S projects(boolean enabled) throws IOException {
<span class="fc" id="L193"> return with(&quot;has_projects&quot;, enabled);</span>
}
/**
* Enables wiki
*
* @param enabled
* true if enabled
* @return a builder to continue with building
* @throws IOException
* In case of any networking error or error from the server.
*/
public S wiki(boolean enabled) throws IOException {
<span class="fc" id="L206"> return with(&quot;has_wiki&quot;, enabled);</span>
}
/**
* Enables downloads
*
* @param enabled
* true if enabled
*
* @return a builder to continue with building
*
* @throws IOException
* In case of any networking error or error from the server.
*/
public S downloads(boolean enabled) throws IOException {
<span class="fc" id="L221"> return with(&quot;has_downloads&quot;, enabled);</span>
}
/**
* Specifies whether the repository is a template.
*
* @param enabled
* true if enabled
* @return a builder to continue with building
* @throws IOException
* In case of any networking error or error from the server.
*/
@Preview(BAPTISTE)
@Deprecated
public S isTemplate(boolean enabled) throws IOException {
<span class="fc" id="L236"> requester.withPreview(BAPTISTE);</span>
<span class="fc" id="L237"> return with(&quot;is_template&quot;, enabled);</span>
}
@Override
public GHRepository done() throws IOException {
<span class="fc" id="L242"> return super.done().wrap(this.root);</span>
}
S archive() throws IOException {
<span class="fc" id="L246"> return with(&quot;archived&quot;, true);</span>
}
S name(String name) throws IOException {
<span class="fc" id="L250"> return with(&quot;name&quot;, name);</span>
}
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span></div></body></html>