Class ClientRefDataQueryUtils


  • public class ClientRefDataQueryUtils
    extends Object
    provides a utility class for the CsvPropertyQuery
    Since:
    17.10.0
    • Method Detail

      • isJsonValid

        public static boolean isJsonValid​(String jsonCheck)
        Performs a quick test to see if JSON is valid, then if passes uses Jackson to parse the JSON
        Parameters:
        jsonCheck - the string JSON value to validate
        Returns:
        true if the String is valid JSON, otherwise false
      • validateJson

        public static String validateJson​(String json)
        validate json using Jackson, returning an error message String or null if no error exists.
        Parameters:
        json - The JSON String to validate
        Returns:
        an error message String or null if no error exists.
      • isXml

        public static boolean isXml​(String strCheck)
        Quick test to see if a string is XML by checking the starting character is a "<" and ending char is ">".
        Parameters:
        strCheck - the string value to test
        Returns:
        true if starts with "<" and ends with ">", otherwise false
      • getRowListFromCsv

        public static List<Map<String,​String>> getRowListFromCsv​(String csvValue)
        Reads a CSV string returning a row list List> that will be queried
        Parameters:
        csvValue - the String property value containing the CSV
        Returns:
        the generated rowList List> or null if CSV can be parsed.
      • toJson

        public static String toJson​(Object object)
        Converts an object to a JSON String with pretty print set using GsonBuilder
        Parameters:
        object - the object to be converted to json
        Returns:
        a JSON formated String with pretty print for the given object