Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Jan 25, 2024
1 parent e0141d1 commit eb3ddda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ protected Inspection(Inspector inspector) {
this.inspector = inspector;
}

protected abstract String getType();
protected abstract String getType();

public Inspector getInspector() {
return inspector;
Expand All @@ -25,7 +25,7 @@ protected Violation noViolation() {
}

protected Violation violation(String description) {
return new Violation(getType(), description);
return new Violation(this, description);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

public final class Violation {

private final String type;
private Inspection inspection;
private Severity severity;
private final String message;

Violation(String type, String message) {
this.type = type;
Violation(Inspection inspection, String message) {
this.inspection = inspection;
this.message = message;
}

public String getType() {
return type;
return inspection.getType();
}

public Severity getSeverity() {
Expand All @@ -25,7 +25,7 @@ public String getMessage() {

@Override
public String toString() {
return type + " | " + severity + " | " + message;
return inspection.getType() + " | " + severity + " | " + message;
}

public Violation withSeverity(Severity severity) {
Expand Down

0 comments on commit eb3ddda

Please sign in to comment.