Skip to main content

Class JsonUtils

java.lang.Object
com.gpudb.util.json.JsonUtils

public class JsonUtils extends Object
  • Constructor Details

    • JsonUtils

      public JsonUtils()
  • Method Details

    • isValidJson

      public static boolean isValidJson(String jsonStr)
    • isValidJson

      public static boolean isValidJson(List<String> list)
    • isValidJsonArray

      public static boolean isValidJsonArray(String jsonStr)
    • isListOfStrings

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

      @Deprecated(since=“7.2.3”, forRemoval=true) public static boolean isListOfValidJsonStrings(List<String> list)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • 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: