Skip to content

Commit

Permalink
merging from master.. still working on #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Pinto committed May 17, 2013
2 parents dbd7ebf + 42f1db0 commit 5002628
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 182 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
<version>1.6.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
61 changes: 30 additions & 31 deletions src/java/main/br/ufpe/cin/groundhog/Project.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package br.ufpe.cin.groundhog;

import japa.parser.ParseException;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

Expand All @@ -12,12 +11,12 @@
public class Project {
private String name;
private String description;
private String creator;
private String owner;
private String iconURL;
private SCM scm;
private String scmURL;
private String sourceCodeURL;

private Date createdAt;
private Date lastPushedAt;

Expand All @@ -30,10 +29,10 @@ public class Project {
private int followersCount;
private int forksCount;
private int issuesCount;

public Project() {
}

/**
* 2-parameter constructor
* @param name the project name
Expand All @@ -54,19 +53,19 @@ public Project(String name, String description, String iconURL) {
this(name, description);
this.iconURL = iconURL;
}

public Project(String name, String description, String iconURL, String sourceCodeURL) {
this(name, description);
this.iconURL = iconURL;
this.sourceCodeURL = sourceCodeURL;
}

public Project(String name, String description, String iconURL, SCM scm, String scmURL) {
this(name, description, iconURL);
this.scm = scm;
this.scmURL = scmURL;
}

public Project(String name, String description, String iconURL, SCM scm, String scmURL,
String sourceCodeURL) {
this(name, description, iconURL, scm, scmURL);
Expand All @@ -80,7 +79,7 @@ public Project(String name, String description, String iconURL, SCM scm, String
public String getName() {
return this.name;
}

/**
* Sets the name of the project
* @param name a {@link String} for the project's name
Expand Down Expand Up @@ -109,18 +108,18 @@ public void setDescription(String description) {
* Informs the project's author name
* @return a String correspondent to the name of the author of the project
*/
public String getCreator() {
return this.creator;
public String getOwner() {
return this.owner;
}

/**
* Informs the project's author name
* @param creator a {@link String} for the name of the project's author
* @param owner a {@link String} for the name of the project's author
*/
public void setCreator(String creator) {
this.creator = creator;
public void setOwner(String owner) {
this.owner = owner;
}

/**
* Informs the project's icon's URL
* @return
Expand All @@ -136,15 +135,15 @@ public String getIconURL() {
public void setIconURL(String iconURL) {
this.iconURL = iconURL;
}

/**
* Informs the project's SCM
* @return
*/
public SCM getSCM() {
return this.scm;
}

public void setSCM(SCM scm) {
this.scm = scm;
}
Expand All @@ -155,15 +154,15 @@ public void setSCM(SCM scm) {
public String getScmURL() {
return this.scmURL;
}

/**
* Sets the project's SCM URL
* @param scmURL
*/
public void setScmURL(String scmURL) {
this.scmURL = scmURL;
}

/**
* Informs the source code URL of the project
* @return a String correspondent to the source code URL of the project in question
Expand Down Expand Up @@ -195,7 +194,7 @@ public boolean hasDownloads() {
public void setHasDownloads(boolean hasDownloads) {
this.hasDownloads = hasDownloads;
}

/**
* @return true if the project has issues. Returns false otherwise.
*/
Expand Down Expand Up @@ -233,7 +232,7 @@ public void setHasWiki(boolean hasWiki) {
public int getWatchersCount() {
return this.watchersCount;
}

/**
* Sets how many people are watching the project
* @param watchersCount an integer for setting the number of people watching the project on its forge
Expand All @@ -257,7 +256,7 @@ public int getFollowersCount() {
public void setFollowersCount(int followersCount) {
this.followersCount = followersCount;
}

/**
* Informs the number of forks the project has
* @return an integer correspondent to the number of forks
Expand All @@ -273,7 +272,7 @@ public int getForksCount() {
public void setForksCount(int forksCount) {
this.forksCount = forksCount;
}

/**
*
* Informs the number of open issues of the project
Expand All @@ -290,30 +289,30 @@ public int getIssuesCount() {
public void setIssuesCount(int issuesCount) {
this.issuesCount = issuesCount;
}

/**
* Tells whether a project is a fork of another or not
* @return a boolean value: true if it's a fork, false otherwise
*/
public boolean isFork() {
return this.isFork;
}

/**
* Sets if the project is a fork of another or not
* @param value a boolean value for informing whether the project is a fork of another or not
*/
public void setIsFork(boolean value) {
this.isFork = value;
}

/**
* Methods that deal with dates are below
* Notice that each setter method is overloaded to support Date and String parameters.
* When the parameter is provided as a String object, the setter method will perform the
* conversion to a date object
*/

/**
* Informs the creation date of the project
* @return a Date object correspondent to the project's creation date
Expand All @@ -329,7 +328,7 @@ public Date getCreatedAt() {
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}

/**
*
* @param createdAtParam the String correspondent to the creation date of the project in question. e.g: 2012-04-28T15:40:35Z
Expand All @@ -338,7 +337,7 @@ public void setCreatedAt(Date createdAt) {
public void setCreatedAt(String createdAtParam) throws java.text.ParseException {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date createAtDate = format.parse(createdAtParam.replace('T', ' ').replace("Z", ""));

this.createdAt = createAtDate;
}

Expand All @@ -358,7 +357,7 @@ public Date getLastPushedAt() {
public void setLastPushedAt(Date lastPushedAtParam) {
this.lastPushedAt = lastPushedAtParam;
}

/**
*
* @param lastPushedAtParam the String correspondent to the date of the last push to the project
Expand Down
2 changes: 1 addition & 1 deletion src/java/main/br/ufpe/cin/groundhog/http/Requests.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.ning.http.client.ListenableFuture;

public class Requests {
private AsyncHttpClient asyncClient;
private final AsyncHttpClient asyncClient;

public Requests() {
this.asyncClient = new AsyncHttpClient();
Expand Down
Loading

0 comments on commit 5002628

Please sign in to comment.