Class StatsPrinterJSON

java.lang.Object
se.liu.ida.hefquin.base.utils.StatsPrinterJSON

public class StatsPrinterJSON extends Object
A utility class for converting and printing Stats objects in JSON format.
  • Constructor Details

    • StatsPrinterJSON

      public StatsPrinterJSON()
  • Method Details

    • print

      public static void print(Stats s, PrintStream out, boolean recursive)
      Converts and prints the given Stats object as JSON to the specified PrintStream.
      Parameters:
      s - the Stats object to print
      out - the output stream to print to
      recursive - whether nested Stats entries should be printed recursively
    • statsAsJson

      public static org.apache.jena.atlas.json.JsonObject statsAsJson(Stats s)
      Converts the given Stats object as JSON. Nested Stats entries will be converted recursively.
      Parameters:
      s - the Stats object to convert
    • statsAsJson

      public static org.apache.jena.atlas.json.JsonObject statsAsJson(Stats s, boolean recursive)
      Converts the given Stats object to a JSON object.
      Parameters:
      s - the Stats object to convert
      recursive - whether nested Stats entries should be converted recursively
      Returns:
      a JSON object representation of the Stats