mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-29 08:21:24 +00:00
65 lines
1.3 KiB
Java
65 lines
1.3 KiB
Java
package org.kohsuke.github;
|
|
|
|
import java.io.IOException;
|
|
import java.net.URL;
|
|
import java.util.Date;
|
|
|
|
/**
|
|
* Represents a status of a commit.
|
|
*
|
|
* @author Kohsuke Kawaguchi
|
|
* @see GHRepository#getLastCommitStatus(String)
|
|
* @see GHCommit#getLastStatus()
|
|
*/
|
|
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() {
|
|
return creator;
|
|
}
|
|
|
|
public String getContext() {
|
|
return context;
|
|
}
|
|
|
|
/**
|
|
* @deprecated This object has no HTML URL.
|
|
*/
|
|
@Override
|
|
public URL getHtmlUrl() {
|
|
return null;
|
|
}
|
|
}
|