Class JsonUtils


  • public class JsonUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> convertNodeStateToMap​(NodeState nodeState, int maxDepth, boolean shouldSerializeHiddenNodesOrProperties)
      Convert a NodeState to a Map representation
      static boolean isValidJson​(java.lang.String text, boolean isJsonArray)  
      static java.lang.String nodeStateToJson​(NodeState nodeState, int maxDepth)
      Converts a NodeState to JSON string with specified depth
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • convertNodeStateToMap

        public static java.util.Map<java.lang.String,​java.lang.Object> convertNodeStateToMap​(NodeState nodeState,
                                                                                                   int maxDepth,
                                                                                                   boolean shouldSerializeHiddenNodesOrProperties)
        Convert a NodeState to a Map representation
        Parameters:
        nodeState - The NodeState to convert
        maxDepth - Maximum depth to traverse
        Returns:
        Map representation of the NodeState
      • nodeStateToJson

        public static java.lang.String nodeStateToJson​(NodeState nodeState,
                                                       int maxDepth)
                                                throws JsonProcessingException
        Converts a NodeState to JSON string with specified depth
        Parameters:
        nodeState - The NodeState to convert
        maxDepth - Maximum depth to traverse, use -1 for unlimited depth
        Returns:
        JSON string representation
        Throws:
        JsonProcessingException - if JSON processing fails
      • isValidJson

        public static boolean isValidJson​(java.lang.String text,
                                          boolean isJsonArray)