Make GHMeta fields effectively final

This commit is contained in:
Liam Newman
2019-11-14 12:07:56 -08:00
parent 6c2ce83b45
commit 7d1e977ffe
4 changed files with 522 additions and 36 deletions

View File

@@ -33,6 +33,7 @@ import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.kohsuke.github.example.dataobject.GHMetaExamples;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
@@ -816,6 +817,22 @@ public class GitHub {
return retrieve().to("/meta", GHMeta.class);
}
/**
* TEST-ONLY
* <p>
* Provides a list of GitHub's IP addresses. For testing and example purposes only.
*
* @see <a href="https://developer.github.com/v3/meta/#meta">Get Meta</a>
*
* @return an instance of {@link GHMeta}
* @throws IOException
* if the credentials supplied are invalid or if you're trying to access it as a GitHub App via the JWT
* authentication
*/
<T extends GHMetaExamples.GHMetaExample> GHMetaExamples.GHMetaExample getMetaExample(Class<T> clazz) throws IOException {
return retrieve().to("/meta", clazz);
}
GHUser intern(GHUser user) throws IOException {
if (user == null)
return user;