diff options
| author | Kevin Sawicki | 2011-04-14 21:56:52 +0000 |
|---|---|---|
| committer | Chris Aniszczyk | 2011-04-15 15:07:58 +0000 |
| commit | 1ea5ffc1d7badbab238e6500f30c7f9888039171 (patch) | |
| tree | 1bb4d8be0329520036938f0af7403c7f5390c6a6 | |
| parent | c3d1a3ba9603b6702673fdba90e2d5d83942f3aa (diff) | |
| download | egit-github-1ea5ffc1d7badbab238e6500f30c7f9888039171.tar.gz egit-github-1ea5ffc1d7badbab238e6500f30c7f9888039171.tar.xz egit-github-1ea5ffc1d7badbab238e6500f30c7f9888039171.zip | |
Add gist history model classes
Change-Id: I1b5d05748ebb2897e4a8b79b9fc04e7e38b25d13
Signed-off-by: Kevin Sawicki <kevin@github.com>
Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
3 files changed, 120 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java index 99e3450f..db1804e2 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Gist.java @@ -11,6 +11,7 @@ package org.eclipse.mylyn.github.internal; import java.util.Date; +import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; @@ -27,6 +28,8 @@ public class Gist { private int comments; + private List<GistRevision> history; + private Map<String, GistFile> files; private String description; @@ -120,6 +123,13 @@ public class Gist { } /** + * @return history + */ + public List<GistRevision> getHistory() { + return this.history; + } + + /** * @return id */ public String getId() { diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistChangeStatus.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistChangeStatus.java new file mode 100644 index 00000000..f164bcc4 --- /dev/null +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistChangeStatus.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * 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; + +/** + * Gist change status class. + */ +public class GistChangeStatus { + + private int additions; + + private int deletions; + + private int total; + + /** + * @return additions + */ + public int getAdditions() { + return this.additions; + } + + /** + * @return deletions + */ + public int getDeletions() { + return this.deletions; + } + + /** + * @return total + */ + public int getTotal() { + return this.total; + } + +} diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java new file mode 100644 index 00000000..60bab860 --- /dev/null +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/GistRevision.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * 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.Date; + +/** + * Gist revision class. + */ +public class GistRevision { + + private Date committedAt; + + private GistChangeStatus changeStatus; + + private String url; + + private String version; + + private User user; + + /** + * @return committedAt + */ + public Date getCommittedAt() { + return this.committedAt; + } + + /** + * @return changeStatus + */ + public GistChangeStatus getChangeStatus() { + return this.changeStatus; + } + + /** + * @return url + */ + public String getUrl() { + return this.url; + } + + /** + * @return version + */ + public String getVersion() { + return this.version; + } + + /** + * @return user + */ + public User getUser() { + return this.user; + } + +} |
