Class StringJsonUtils


  • public class StringJsonUtils
    extends Object
    Helper class to encapsulate simple checks used in the DefaultJsonMapper.
    • Method Detail

      • isEmptyList

        public static boolean isEmptyList​(String jsonString)
        Is the given JSON equivalent to the empty list ([])?
        Parameters:
        jsonString - The JSON to check.
        Returns:
        true if the JSON is equivalent to the empty list, false otherwise.
      • isList

        public static boolean isList​(String jsonString)
        Checks if the given String start with a [ character, so it may be a JsonArray
        Parameters:
        jsonString - the JSON to check.
        Returns:
        true if the String may be a JSON Array
      • isNull

        public static boolean isNull​(String jsonString)
        Checks if the given String is equals to the String with the content "null"
        Parameters:
        jsonString - the JSON to check.
        Returns:
        true if the String is "null"
      • isFalse

        public static boolean isFalse​(String jsonString)
        Checks if the given String is equals to the String with the content "false"
        Parameters:
        jsonString - the JSON to check.
        Returns:
        true if the String is "false"
      • isObject

        public static boolean isObject​(String jsonString)
        Checks if the given String start with a { character, so it may be a JsonObject
        Parameters:
        jsonString - the JSON to check.
        Returns:
        true if the String may be a JSON object
      • isEmptyObject

        public static boolean isEmptyObject​(String jsonString)
        Is the given JSON equivalent to the empty object ({})?
        Parameters:
        jsonString - The JSON to check.
        Returns:
        true if the JSON is equivalent to the empty object, false otherwise.