Package it.unive.lisa.outputs
Class JsonReport
- java.lang.Object
-
- it.unive.lisa.outputs.JsonReport
-
public class JsonReport extends java.lang.ObjectA report of an executed analysis that can be dumped in json format, and that can be read from a json file.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJsonReport.JsonWarningA warning that is ready to dump into aJsonReport.
-
Constructor Summary
Constructors Constructor Description JsonReport()Builds an empty report.JsonReport(java.util.Collection<Warning> warnings, java.util.Collection<java.lang.String> files)Builds the report, containing the given warnings and files.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddump(java.io.Writer writer)Dumps this report to the givenWriterinstance, serializing it as a json object.booleanequals(java.lang.Object obj)java.util.Collection<java.lang.String>getFiles()Yields the collection of file names contained into this report.java.util.Collection<JsonReport.JsonWarning>getWarnings()Yields the collection ofJsonReport.JsonWarnings contained into this report.inthashCode()static JsonReportread(java.io.Reader reader)Reads aJsonReportfrom aReaderinstance, deserializing it as a json object.java.lang.StringtoString()
-
-
-
Constructor Detail
-
JsonReport
public JsonReport()
Builds an empty report.
-
JsonReport
public JsonReport(java.util.Collection<Warning> warnings, java.util.Collection<java.lang.String> files)
Builds the report, containing the given warnings and files.- Parameters:
warnings- the collection of warnings to map toJsonReport.JsonWarningsfiles- the collections of file names to include
-
-
Method Detail
-
getWarnings
public java.util.Collection<JsonReport.JsonWarning> getWarnings()
Yields the collection ofJsonReport.JsonWarnings contained into this report.- Returns:
- the collection of warnings
-
getFiles
public java.util.Collection<java.lang.String> getFiles()
Yields the collection of file names contained into this report. These represents the names of the files that have been created during the analysis, and should be interpreted as paths relative to the workdir of the analysis (or the folder containing this report, if this was read from a file).- Returns:
- the collection of file names
-
dump
public void dump(java.io.Writer writer) throws java.io.IOExceptionDumps this report to the givenWriterinstance, serializing it as a json object.- Parameters:
writer- the writer to write to- Throws:
java.io.IOException- if some I/O error happens while writing to the writer
-
read
public static JsonReport read(java.io.Reader reader) throws java.io.IOException
Reads aJsonReportfrom aReaderinstance, deserializing it as a json object.- Parameters:
reader- the reader to read from- Returns:
- the read report
- Throws:
java.io.IOException- if some I/O error happens while reading from the reader
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-