Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rules): touchups for Jackson serialization #301

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading