de.otto.jlineup.report.JSONReportWriter_V2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jlineup Show documentation
Show all versions of jlineup Show documentation
Webapp image comparison tool
package de.otto.jlineup.report;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import de.otto.jlineup.file.FileService;
import java.io.FileNotFoundException;
public class JSONReportWriter_V2 implements JSONReportWriter {
private final FileService fileService;
private final Gson gson = new GsonBuilder().setPrettyPrinting().create();
public JSONReportWriter_V2(FileService fileService) {
this.fileService = fileService;
}
public void writeComparisonReportAsJson(Report report) throws FileNotFoundException {
final String reportJson = gson.toJson(report);
fileService.writeJsonReport(reportJson);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy