Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

Gh 23 #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,61 @@

/**
* Interface defining the operations for working with GitHub gists.
*
*
* @author Willie Wheeler ([email protected])
*/
public interface GistOperations {

/**
* Public operation to return the given user's public gists.
*
*
* @param user GitHub user
* @return list of user's gists
*/
List<GitHubGist> getUserGists(String user);

/**
* <p>
* If authenticated, this method returns the current user's gists. Otherwise it returns all public gists.
* </p>
*
*
* @return current user's gists, or else all public gists
*/
List<GitHubGist> getGists();

/**
* Public operation to return all public gists.
*
*
* @return all public gists
*/
List<GitHubGist> getPublicGists();

/**
* Returns the authenticated user's starred gists.
*
*
* @return authenticated user's starred gists
*/
List<GitHubGist> getStarredGists();

/**
* Returns the gist with the given ID.
*
*
* @param id gist ID
* @return gist
*/
GitHubGist getGist(String id);

/**
* Public operation to return the comments on a given gist.
*
*
* @param gistId gist ID
* @return gist comments
*/
List<GitHubComment> getGistComments(String gistId);

/**
* Public operation to return a gist comment.
*
*
* @param id comment ID
* @return comment
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,60 @@
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A GitHub comment.
*
*
* @author Willie Wheeler ([email protected])
* @author Andy Wilkinson
*/
@SuppressWarnings("serial")
public class GitHubComment implements Serializable {

private final long id;
private final long id;

private final String url;
private final String url;

private final GitHubUser user;
private final GitHubUser user;

private final Date createdAt;
private final Date createdAt;

private final Date updatedAt;
private final Date updatedAt;

private volatile String body;
private volatile String body;

public GitHubComment(long id, String url, GitHubUser user, Date createdAt, Date updatedAt) {
this.id = id;
this.url = url;
this.user = user;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public GitHubComment(long id, String url, GitHubUser user, Date createdAt, Date updatedAt) {
this.id = id;
this.url = url;
this.user = user;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}

public long getId() {
return id;
}
public long getId() {
return id;
}

public String getUrl() {
return url;
}
public String getUrl() {
return url;
}

public GitHubUser getUser() {
return user;
}
public GitHubUser getUser() {
return user;
}

public Date getCreatedAt() {
return createdAt;
}
public Date getCreatedAt() {
return createdAt;
}

public Date getUpdatedAt() {
return updatedAt;
}
public Date getUpdatedAt() {
return updatedAt;
}

public String getBody() {
return body;
}
public String getBody() {
return body;
}

public void setBody(String body) {
this.body = body;
}
public void setBody(String body) {
this.body = body;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
* A GitHub repository commit.
*
*
* @author Willie Wheeler ([email protected])
*/
@SuppressWarnings("serial")
Expand All @@ -37,15 +35,15 @@ public class GitHubCommit implements Serializable {

private final GitHubUser author;

public GitHubCommit(String message, String sha, String url, GitHubUser committer, GitHubUser author) {
this.message = message;
this.sha = sha;
this.url = url;
this.committer = committer;
this.author = author;
}
public GitHubCommit(String message, String sha, String url, GitHubUser committer, GitHubUser author) {
this.message = message;
this.sha = sha;
this.url = url;
this.committer = committer;
this.author = author;
}

/**
/**
* @return commit message
*/
public String getMessage() { return message; }
Expand All @@ -61,8 +59,8 @@ public GitHubCommit(String message, String sha, String url, GitHubUser committer
*/
public GitHubUser getCommitter() { return committer; }

/**
* @return user who wrote the patch
*/
public GitHubUser getAuthor() { return author; }
/**
* @return user who wrote the patch
*/
public GitHubUser getAuthor() { return author; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
package org.springframework.social.github.api;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A GitHub download.
*
*
* @author Willie Wheeler ([email protected])
* @author Andy Wilkinson
*/
Expand All @@ -46,19 +42,19 @@ public class GitHubDownload implements Serializable {

private final String contentType;

public GitHubDownload(long id, String url, String htmlUrl, String name, String description, long size,
int downloadCount, String contentType) {
this.id = id;
this.url = url;
this.htmlUrl = htmlUrl;
this.name = name;
this.description = description;
this.size = size;
this.downloadCount = downloadCount;
this.contentType = contentType;
}

public long getId() { return id; }
public GitHubDownload(long id, String url, String htmlUrl, String name, String description, long size,
int downloadCount, String contentType) {
this.id = id;
this.url = url;
this.htmlUrl = htmlUrl;
this.name = name;
this.description = description;
this.size = size;
this.downloadCount = downloadCount;
this.contentType = contentType;
}

public long getId() { return id; }

public String getUrl() { return url; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,43 @@

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* A GitHub file.
*
*
* @author Willie Wheeler ([email protected])
* @author Andy Wilkinson
*/
@SuppressWarnings("serial")
public class GitHubFile implements Serializable {

private final String type;
private final String type;

private final String language;
private final String language;

private final String rawUrl;
private final String rawUrl;

private final long size;
private final long size;

private String filename;
private String filename;

private String content;
private String content;

public GitHubFile(String type, String language, String rawUrl, long size) {
this.type = type;
this.language = language;
this.rawUrl = rawUrl;
this.size = size;
}
public GitHubFile(String type, String language, String rawUrl, long size) {
this.type = type;
this.language = language;
this.rawUrl = rawUrl;
this.size = size;
}

public String getType() { return type; }
public String getType() { return type; }

public String getLanguage() { return language; }
public String getLanguage() { return language; }

public String getRawUrl() { return rawUrl; }
public String getRawUrl() { return rawUrl; }

public long getSize() { return size; }
public long getSize() { return size; }

public String getFilename() { return filename; }
public String getFilename() { return filename; }

public void setFilename(String filename) { this.filename = filename; }

Expand Down
Loading