From d6ac5a18099dd5d9b3b5601d9db1ce548067bc84 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Mon, 20 Nov 2023 13:30:11 -0500 Subject: [PATCH] chore(rules): touchups for Jackson serialization --- .../reports/InterruptibleReportGenerator.java | 44 ++++++++++++------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/src/main/java/io/cryostat/core/reports/InterruptibleReportGenerator.java b/src/main/java/io/cryostat/core/reports/InterruptibleReportGenerator.java index 3d805476..704687b1 100644 --- a/src/main/java/io/cryostat/core/reports/InterruptibleReportGenerator.java +++ b/src/main/java/io/cryostat/core/reports/InterruptibleReportGenerator.java @@ -225,16 +225,26 @@ private Pair, 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() { @@ -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 suggestions; + private String summary; + private String explanation; + private String solution; + private List suggestions; + + Evaluation() {} Evaluation(IResult result) { this.summary = ResultToolkit.populateMessage(result, result.getSummary(), false); @@ -287,9 +299,11 @@ public List 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();