Package glair.vision.util
Class Json
java.lang.Object
glair.vision.util.Json
Utility class for working with JSON data and formatting.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringtoJsonString(String key, String value) Formats a single key-value pair into a JSON string.static StringtoJsonString(HashMap<String, String> map) Formats a map of key-value pairs into a JSON string.static StringtoJsonString(HashMap<String, String> map, int indent) Formats a map of key-value pairs into a JSON string with indentation.
-
Constructor Details
-
Json
public Json()
-
-
Method Details
-
toJsonString
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
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
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.
-