unifying issue and pull request.

This commit is contained in:
Kohsuke Kawaguchi
2011-06-24 17:31:05 -07:00
parent 409eda1cbc
commit 898a190312
3 changed files with 41 additions and 51 deletions

View File

@@ -24,8 +24,12 @@
package org.kohsuke.github;
import java.net.URL;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
/**
* @author Eric Maupin
@@ -33,27 +37,50 @@ import java.util.List;
public class GHIssue {
GitHub root;
private String gravatar_id,body,title,state,created_at;
private String gravatar_id,body,title,state,created_at,updated_at,html_url;
private List<String> labels;
private int number,votes,comments;
private int position;
/**
* The description of this pull request.
*/
public String getBody() {
return body;
}
/**
* ID.
*/
public int getNumber() {
return number;
}
/**
* The HTML page of this issue,
* like https://github.com/jenkinsci/jenkins/issues/100
*/
public URL getUrl() {
return GitHub.parseURL(html_url);
}
public String getTitle() {
return title;
}
public String getBody() {
return body;
}
public GHIssueState getState() {
return Enum.valueOf(GHIssueState.class, state);
}
public Iterable<String> getLabels() {
return (Iterable<String>)labels;
public Collection<String> getLabels() {
return Collections.unmodifiableList(labels);
}
public Date getCreatedAt() {
return GitHub.parseDate(created_at);
}
public Date getUpdatedAt() {
return GitHub.parseDate(updated_at);
}
}