Class JsonUtils


  • public class JsonUtils
    extends Object
    • Constructor Detail

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • isValidJson

        public static boolean isValidJson​(String jsonStr)
      • isValidJsonArray

        public static boolean isValidJsonArray​(String jsonStr)
      • isListOfStrings

        public static <T> boolean isListOfStrings​(List<T> list)
      • isListOfValidJsonStrings

        public static boolean isListOfValidJsonStrings​(List<String> list)
      • isListOfRecordBase

        public static <T> boolean isListOfRecordBase​(List<T> list)
      • toJsonArray

        public static String toJsonArray​(List<String> list)
        Converts a List to a JSON array where each element is a valid JSON String
        Parameters:
        list - - the parameterized input list
        Returns:
        a string representation of a JSON array of the given list of JSON strings
      • toJsonString

        public static String toJsonString​(Object value)
                                   throws GPUdbException
        Wrapper for ObjectMapper().writeValueAsString that throws GPUdbException
        Parameters:
        value - - object to convert to JSON string
        Returns:
        a JSON string representation of the given object
        Throws:
        GPUdbException