Skip to content

Commit

Permalink
Merge pull request #477 from martinvanzijl/issue_330_statistics
Browse files Browse the repository at this point in the history
Add statistics API.
  • Loading branch information
bitwiseman authored Oct 5, 2019
2 parents 8450173 + f9aa1ad commit 7c065c1
Show file tree
Hide file tree
Showing 43 changed files with 303,532 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/main/java/org/kohsuke/github/GHRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
package org.kohsuke.github;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
import com.infradna.tool.bridge_method_injector.WithBridgeMethods;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -51,10 +54,11 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.WeakHashMap;

import static java.util.Arrays.*;
import java.util.NoSuchElementException;
import java.util.logging.Level;
import java.util.logging.Logger;

import static java.util.Arrays.*;
import static org.kohsuke.github.Previews.*;

/**
Expand Down Expand Up @@ -1404,7 +1408,7 @@ public Map<String,GHBranch> getBranches() throws IOException {
/**
* Replace special characters (e.g. #) with standard values (e.g. %23) so
* GitHub understands what is being requested.
* @param The string to be encoded.
* @param value string to be encoded.
* @return The encoded string.
*/
private String UrlEncode(String value) {
Expand Down Expand Up @@ -1646,6 +1650,15 @@ public boolean equals(Object obj) {
}
}

/**
* Returns the statistics for this repository.
*/
public GHRepositoryStatistics getStatistics() {
// TODO: Use static object and introduce refresh() method,
// instead of returning new object each time.
return new GHRepositoryStatistics(this);
}

/**
* Create a project for this repository.
*/
Expand Down
Loading

0 comments on commit 7c065c1

Please sign in to comment.