mirror of
https://github.com/jlengrand/github-api.git
synced 2026-04-08 08:21:23 +00:00
if the user record does not exist yet, there's no need to fetch that eagerly, as they are fetched on demand via the populate() method.
65 lines
1.4 KiB
Java
65 lines
1.4 KiB
Java
package org.kohsuke.github;
|
|
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
|
|
/**
|
|
* Represents a status of a commit.
|
|
*
|
|
* @author Kohsuke Kawaguchi
|
|
* @see GHRepository#getLastCommitStatus(String)
|
|
* @see GHCommit#getLastStatus()
|
|
* @see GHRepository#createCommitStatus(String, GHCommitState, String, String)
|
|
*/
|
|
public class GHCommitStatus extends GHObject {
|
|
String state;
|
|
String target_url,description;
|
|
String context;
|
|
GHUser creator;
|
|
|
|
private GitHub root;
|
|
|
|
/*package*/ GHCommitStatus wrapUp(GitHub root) {
|
|
if (creator!=null) creator.wrapUp(root);
|
|
this.root = root;
|
|
return this;
|
|
}
|
|
|
|
public GHCommitState getState() {
|
|
for (GHCommitState s : GHCommitState.values()) {
|
|
if (s.name().equalsIgnoreCase(state))
|
|
return s;
|
|
}
|
|
throw new IllegalStateException("Unexpected state: "+state);
|
|
}
|
|
|
|
/**
|
|
* The URL that this status is linked to.
|
|
*
|
|
* This is the URL specified when creating a commit status.
|
|
*/
|
|
public String getTargetUrl() {
|
|
return target_url;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return description;
|
|
}
|
|
|
|
public GHUser getCreator() throws IOException {
|
|
return root.intern(creator);
|
|
}
|
|
|
|
public String getContext() {
|
|
return context;
|
|
}
|
|
|
|
/**
|
|
* @deprecated This object has no HTML URL.
|
|
*/
|
|
@Override
|
|
public URL getHtmlUrl() {
|
|
return null;
|
|
}
|
|
}
|