summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-25 14:58:59 (EDT)
committer Kevin Sawicki2011-04-25 15:01:38 (EDT)
commit128aa1ca1417e52fcfc48f00c8b39cdef5cc9403 (patch)
tree381468d0c0e54edde619e7e9857986cc7479d653
parent77072b9716fc10a1003f0b10398f0a1eeb328747 (diff)
downloadegit-github-128aa1ca1417e52fcfc48f00c8b39cdef5cc9403.zip
egit-github-128aa1ca1417e52fcfc48f00c8b39cdef5cc9403.tar.gz
egit-github-128aa1ca1417e52fcfc48f00c8b39cdef5cc9403.tar.bz2
Add full repository model support.refs/changes/44/3244/2
Change-Id: I1a0bf341baad619ed1446d7bd28e8212150e69ac Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Repository.java137
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RepositoryContainer.java33
2 files changed, 169 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Repository.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Repository.java
index 5cf1fad..05c520d 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Repository.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Repository.java
@@ -10,6 +10,10 @@
*******************************************************************************/
package org.eclipse.mylyn.github.internal;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.Date;
+
import org.eclipse.core.runtime.Assert;
/**
@@ -19,8 +23,27 @@ import org.eclipse.core.runtime.Assert;
*/
public class Repository {
- private String owner;
+ private boolean fork;
+ private boolean hasDownloads;
+ private boolean hasIssues;
+ private boolean hasWiki;
+ @SerializedName("private")
+ private boolean isPrivate;
+
+ private Date createdAt;
+ private Date pushedAt;
+
+ private String description;
+ private String homepage;
+ private String language;
private String name;
+ private String owner;
+ private String url;
+
+ private int forks;
+ private int openIssues;
+ private int size;
+ private int watchers;
/**
* Create repository with owner and name
@@ -39,6 +62,13 @@ public class Repository {
}
/**
+ * Create repository
+ */
+ Repository() {
+
+ }
+
+ /**
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
@@ -87,4 +117,109 @@ public class Repository {
return this.name;
}
+ /**
+ * @return fork
+ */
+ public boolean isFork() {
+ return this.fork;
+ }
+
+ /**
+ * @return hasDownloads
+ */
+ public boolean isHasDownloads() {
+ return this.hasDownloads;
+ }
+
+ /**
+ * @return hasIssues
+ */
+ public boolean isHasIssues() {
+ return this.hasIssues;
+ }
+
+ /**
+ * @return hasWiki
+ */
+ public boolean isHasWiki() {
+ return this.hasWiki;
+ }
+
+ /**
+ * @return isPrivate
+ */
+ public boolean isPrivate() {
+ return this.isPrivate;
+ }
+
+ /**
+ * @return createdAt
+ */
+ public Date getCreatedAt() {
+ return this.createdAt;
+ }
+
+ /**
+ * @return pushedAt
+ */
+ public Date getPushedAt() {
+ return this.pushedAt;
+ }
+
+ /**
+ * @return description
+ */
+ public String getDescription() {
+ return this.description;
+ }
+
+ /**
+ * @return homepage
+ */
+ public String getHomepage() {
+ return this.homepage;
+ }
+
+ /**
+ * @return language
+ */
+ public String getLanguage() {
+ return this.language;
+ }
+
+ /**
+ * @return url
+ */
+ public String getUrl() {
+ return this.url;
+ }
+
+ /**
+ * @return forks
+ */
+ public int getForks() {
+ return this.forks;
+ }
+
+ /**
+ * @return openIssues
+ */
+ public int getOpenIssues() {
+ return this.openIssues;
+ }
+
+ /**
+ * @return size
+ */
+ public int getSize() {
+ return this.size;
+ }
+
+ /**
+ * @return watchers
+ */
+ public int getWatchers() {
+ return this.watchers;
+ }
+
}
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RepositoryContainer.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RepositoryContainer.java
new file mode 100644
index 0000000..aa0b1e9
--- /dev/null
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/RepositoryContainer.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 GitHub Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.mylyn.github.internal;
+
+import java.util.List;
+
+/**
+ * Repository container class.
+ *
+ * @author Kevin Sawicki (kevin@github.com)
+ */
+public class RepositoryContainer {
+
+ private List<Repository> repositories;
+
+ /**
+ * Get repositories
+ *
+ * @return list of repositories
+ */
+ public List<Repository> getRepositories() {
+ return this.repositories;
+ }
+
+}