Skip to content

Commit

Permalink
chore(rules): touchups for Jackson serialization (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Jan 8, 2024
1 parent d8fedac commit 8f60aa2
Showing 1 changed file with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,26 @@ private Pair<Collection<IResult>, Long> generateResultHelper(
}

public static class AnalysisResult {
private final String name;
private final String topic;
private final double score;
private final Evaluation evaluation;
private String name;
private String topic;
private double score;
private Evaluation evaluation;

AnalysisResult(double score, IResult result) {
AnalysisResult() {}

AnalysisResult(String name, String topic, double score, Evaluation evaluation) {
this.name = name;
this.topic = topic;
this.score = score;
this.name = result.getRule().getName();
this.topic = result.getRule().getTopic();
this.evaluation = new Evaluation(result);
this.evaluation = evaluation;
}

AnalysisResult(double score, IResult result) {
this(
result.getRule().getName(),
result.getRule().getTopic(),
score,
new Evaluation(result));
}

public double getScore() {
Expand All @@ -254,10 +264,12 @@ public Evaluation getEvaluation() {
}

public static class Evaluation {
private final String summary;
private final String explanation;
private final String solution;
private final List<Suggestion> suggestions;
private String summary;
private String explanation;
private String solution;
private List<Suggestion> suggestions;

Evaluation() {}

Evaluation(IResult result) {
this.summary = ResultToolkit.populateMessage(result, result.getSummary(), false);
Expand Down Expand Up @@ -287,9 +299,11 @@ public List<Suggestion> getSuggestions() {
}

public static class Suggestion {
private final String name;
private final String setting;
private final String value;
private String name;
private String setting;
private String value;

Suggestion() {}

Suggestion(IRecordingSetting setting) {
this.name = setting.getSettingName();
Expand Down

0 comments on commit 8f60aa2

Please sign in to comment.