Skip to content
Snippets Groups Projects

Issuedir

Merged Jack MacLauchlan CS2015 requested to merge issuedir into master
6 files
+ 152
44
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 39
0
package command;
import issueData.IssueRepository;
public class CommandShow implements Command {
private String id;
public CommandShow(String id) {
this.id = id;
}
@Override
public void execute() {
IssueRepository repository = new IssueRepository();
repository.getIssues().forEach(issue -> {
if (issue.getOriginalHash().equals(id)) {
String status = issue.isopen() ? "Open" : "Closed";
System.out.println("Issue title: " + issue.getTitle() + "\n" +
"Issue Description: " + issue.getDescription() + "\n" +
"Status: " + status + "\n" +
"Creator: " + issue.getCreator() + "\n" +
"Last edited: " + issue.getEdited() + "\n" +
"Creation time: " + issue.getCreationTime());
if (issue.getComments().isEmpty()) {
System.out.println("\nNo comments on this issue");
} else {
System.out.println("\nComments:\n");
issue.getComments().forEach(comment -> System.out.println("Author: " + comment.getAuthor() + "\n" + comment.getMessage() + "\n"));
}
}
});
}
}
Loading