Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Added files methods to core (#284)
Browse files Browse the repository at this point in the history
* added files to core

* added RepoFile class and List<RepoFile>

* final changes to repofile class

* remove quotes
  • Loading branch information
Courtneyp123 committed Nov 9, 2020
1 parent b1b2dbc commit c772a3d
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 5 deletions.
113 changes: 113 additions & 0 deletions src/main/java/com/capitalone/dashboard/model/RepoFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package com.capitalone.dashboard.model;

public class RepoFile {
private String filename;
private String patch;
private String sha;
private String status;
private int additions;
private int deletions;
private int changes;
private String blob_url;
private String raw_url;
private String contents_url;

public RepoFile () {

}

public RepoFile (String filename, String patch, String sha, String status, int additions, int deletions, int changes,
String blob_url, String raw_url, String contents_url) {
this.filename = filename;
this. patch = patch;
this.sha = sha;
this.status = status;
this.additions = additions;
this.deletions = deletions;
this.changes = changes;
this.blob_url = blob_url;
this.raw_url = raw_url;
this.contents_url = contents_url;
}

public String getFilename() {
return this.filename;
}

public void setFilename(String filename) {
this.filename = filename;
}

public String getPatch() {
return this.patch;
}

public void setPatch(String patch) {
this.patch = patch;
}

public String getSha() {
return this.sha;
}

public void setSha(String sha) {
this.sha = sha;
}

public String getStatus() {
return this.status;
}

public void setStatus(String status) {
this.status = status;
}

public int getAdditions() {
return this.additions;
}

public void setAdditions(int additions) {
this.additions = additions;
}

public int getDeletions() {
return this.deletions;
}

public void setDeletions(int deletions) {
this.deletions = deletions;
}

public int getChanges() {
return this.changes;
}

public void setChanges(int changes) {
this.changes = changes;
}

public String getBlob_url() {
return this.blob_url;
}

public void setBlob_url(String blob_url) {
this.blob_url = blob_url;
}

public String getRaw_url() {
return this.raw_url;
}

public void setRaw_url(String raw_url) {
this.raw_url = raw_url;
}

public String getContents_url() {
return this.contents_url;
}

public void setContents_url(String contents_url) {
this.contents_url = contents_url;
}
}

17 changes: 12 additions & 5 deletions src/main/java/com/capitalone/dashboard/model/SCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class SCM {
protected String scmUrl;
protected String scmBranch; // For SCM that don't have branch in the url
protected String scmRevisionNumber;
protected String scmRevisionNumber;
protected String scmCommitLog;
protected String scmAuthor;
protected String scmAuthorType;
Expand All @@ -26,11 +26,12 @@ public class SCM {
protected List<String> filesAdded;
protected List<String> filesRemoved;
protected List<String> filesModified;
protected List<RepoFile> files;

public SCM(){

}

public SCM(SCM scm) {
this.scmUrl = scm.scmUrl;
this.scmBranch = scm.scmBranch;
Expand All @@ -46,6 +47,7 @@ public SCM(SCM scm) {
this.filesAdded = scm.filesAdded;
this.filesRemoved = scm.filesRemoved;
this.filesModified = scm.filesModified;
this.files = scm.files;
}

@SuppressWarnings({"PMD.ExcessiveParameterList"})
Expand All @@ -57,6 +59,7 @@ public SCM(String scmUrl,
String scmAuthorType,
String scmAuthorLogin,
List<String> scmParentRevisionNumbers,
List<RepoFile> files,
long scmCommitTimestamp,
long numberOfChanges,
CommitType type) {
Expand All @@ -72,6 +75,7 @@ public SCM(String scmUrl,
this.scmCommitTimestamp = scmCommitTimestamp;
this.numberOfChanges = numberOfChanges;
this.type = type;
this.files = files;

}

Expand All @@ -81,7 +85,7 @@ public SCM(String scmUrl,

public String getScmBranch() { return scmBranch; }

public void setScmBranch(String scmBranch) { this.scmBranch = scmBranch; }
public void setScmBranch(String scmBranch) { this.scmBranch = scmBranch; }

public String getScmRevisionNumber() { return scmRevisionNumber; }

Expand All @@ -102,10 +106,10 @@ public SCM(String scmUrl,
public String getScmAuthorLogin() { return scmAuthorLogin; }

public void setScmAuthorLogin(String scmAuthorLogin) { this.scmAuthorLogin = scmAuthorLogin; }

// can return null
public List<String> getScmParentRevisionNumbers() { return scmParentRevisionNumbers; }

public void setScmParentRevisionNumbers(List<String> scmParentRevisionNumbers) { this.scmParentRevisionNumbers = scmParentRevisionNumbers; }

public long getScmCommitTimestamp() { return scmCommitTimestamp; }
Expand Down Expand Up @@ -160,6 +164,9 @@ public void setFilesModified(List<String> filesModified) {
this.filesModified = filesModified;
}

public List<RepoFile> getFiles() { return files; }

public void setFiles(List<RepoFile> files) { this.files = files; }

@Override
public boolean equals(Object o) {
Expand Down

0 comments on commit c772a3d

Please sign in to comment.