Class Json

java.lang.Object
glair.vision.util.Json

public class Json extends Object
Utility class for working with JSON data and formatting.
  • Constructor Details

    • Json

      public Json()
  • Method Details

    • toJsonString

      public static String toJsonString(String key, String value)
      Formats a single key-value pair into a JSON string.
      Parameters:
      key - The key.
      value - The value.
      Returns:
      The formatted JSON object as a string.
    • toJsonString

      public static String toJsonString(HashMap<String,String> map)
      Formats a map of key-value pairs into a JSON string.
      Parameters:
      map - The map containing key-value pairs.
      Returns:
      The formatted JSON object as a string.
    • toJsonString

      public static String toJsonString(HashMap<String,String> map, int indent)
      Formats a map of key-value pairs into a JSON string with indentation.
      Parameters:
      map - The map containing key-value pairs.
      indent - The number of spaces for indentation.
      Returns:
      The formatted JSON object as a string.