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

Create new repository for filter commit type #292

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<groupId>com.capitalone.dashboard</groupId>
<artifactId>core</artifactId>
<packaging>jar</packaging>
<version>3.13.1</version>
<version>3.13.2</version>
<name>${project.groupId}:${project.artifactId}</name>
<description>Core package shared by API layer and Microservices</description>
<url>https://github.com/Hygieia/hygieia-core</url>
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/com/capitalone/dashboard/model/FilterCommitType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.capitalone.dashboard.model;

import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Map;

@Document(collection="filter_commit_types")
public class FilterCommitType extends BaseModel{

private String commitLogRegex;
private boolean doContentCheck;
private Map<String, String> contentPatterns;

/* Example
{
"commitLogRegex" : "(.)*(yourRegex)(.)*",
"doContentCheck" : false
},
{
"commitLogRegex" : "(.)*(yourRegex)(.)*",
"doContentCheck" : true,
"contentPatterns" : {
"somePattern" : "(.)*(somePattern)(.)*"
}
}
*/

public FilterCommitType(String commitLogRegex, boolean doContentCheck, Map<String, String> contentPatterns) {
this.commitLogRegex = commitLogRegex;
this.doContentCheck = doContentCheck;
this.contentPatterns = contentPatterns;
}

public String getCommitLogRegex() {
return commitLogRegex;
}

public void setCommitLogRegex(String commitLogRegex) {
this.commitLogRegex = commitLogRegex;
}

public boolean doContentCheck() { return doContentCheck; }

public void setDoContentCheck(boolean doContentCheck) { this.doContentCheck = doContentCheck; }

public Map<String, String> getContentPatterns() { return contentPatterns; }

public String getContentPattern(String patternType) { return contentPatterns.get(patternType); }

public void setContentPatterns(Map<String, String> contentPatterns) { this.contentPatterns = contentPatterns; }

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.capitalone.dashboard.repository;

import com.capitalone.dashboard.model.FilterCommitType;
import org.bson.types.ObjectId;
import org.springframework.data.repository.CrudRepository;

public interface FilterCommitTypeRepository extends CrudRepository<FilterCommitType, ObjectId> {
}