Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-12-14 17:52:30 +0000
committerKevin Sawicki2011-12-14 17:53:13 +0000
commitfade89bab995b05b4766746bfd67349e08629ae3 (patch)
tree46e8eaa4e847334ba6ce4da0f77020ccaf79c4d4
parent27cc61cc8aa74f3781959da549ea065f15fe26d3 (diff)
downloadegit-github-fade89bab995b05b4766746bfd67349e08629ae3.tar.gz
egit-github-fade89bab995b05b4766746bfd67349e08629ae3.tar.xz
egit-github-fade89bab995b05b4766746bfd67349e08629ae3.zip
Add missing id and updated at fields to Repository model
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryTest.java5
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Repository.java36
2 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryTest.java
index 5abe1779..265cf104 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryTest.java
@@ -58,6 +58,8 @@ public class RepositoryTest {
assertFalse(repo.isHasIssues());
assertFalse(repo.isHasWiki());
assertFalse(repo.isPrivate());
+ assertEquals(0, repo.getId());
+ assertNull(repo.getUpdatedAt());
}
/**
@@ -97,6 +99,9 @@ public class RepositoryTest {
assertTrue(repo.setHasWiki(true).isHasWiki());
assertTrue(repo.setPrivate(true).isPrivate());
assertEquals("mirror", repo.setMirrorUrl("mirror").getMirrorUrl());
+ assertEquals(14, repo.setId(14).getId());
+ assertEquals(new Date(50000), repo.setUpdatedAt(new Date(50000))
+ .getUpdatedAt());
}
/**
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Repository.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Repository.java
index b0c53f96..a60c7afc 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Repository.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Repository.java
@@ -40,8 +40,12 @@ public class Repository implements IRepositoryIdProvider, Serializable {
private Date pushedAt;
+ private Date updatedAt;
+
private int forks;
+ private long id;
+
private int openIssues;
private int size;
@@ -495,6 +499,38 @@ public class Repository implements IRepositoryIdProvider, Serializable {
}
/**
+ * @return updatedAt
+ */
+ public Date getUpdatedAt() {
+ return DateUtils.clone(updatedAt);
+ }
+
+ /**
+ * @param updatedAt
+ * @return this repository
+ */
+ public Repository setUpdatedAt(Date updatedAt) {
+ this.updatedAt = DateUtils.clone(updatedAt);
+ return this;
+ }
+
+ /**
+ * @return id
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param id
+ * @return this repository
+ */
+ public Repository setId(long id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
* Generate id for this repository
*
* @see IRepositoryIdProvider#generateId()

Back to the top