Class JsonUtils


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

      Constructors 
      Constructor Description
      JsonUtils()  
    • Method Summary

      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.Object> createBody​(com.google.gson.JsonObject jsonObject)
      Creates the body object from a json object.
      static java.util.List<java.lang.Object> createList​(com.google.gson.JsonArray array)
      Creates the list instance from a json array.
      static java.lang.Object createObject​(com.google.gson.JsonElement element)
      Creates the object instance from a json element.
      static java.lang.Object createObject​(java.lang.String json)
      Creates a instance from a json definition.
      static com.google.gson.JsonElement toJsonTree​(java.lang.Object object)  
      • Methods inherited from class java.lang.Object

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

      • JsonUtils

        public JsonUtils()
    • Method Detail

      • createObject

        public static java.lang.Object createObject​(java.lang.String json)
        Creates a instance from a json definition.
        Parameters:
        json - Json definition.
        Returns:
        Object instance.
      • createBody

        public static java.util.Map<java.lang.String,​java.lang.Object> createBody​(com.google.gson.JsonObject jsonObject)
        Creates the body object from a json object.
        Parameters:
        jsonObject - Json object instance.
        Returns:
        Map with all the fields of the object.
      • createList

        public static java.util.List<java.lang.Object> createList​(com.google.gson.JsonArray array)
        Creates the list instance from a json array.
        Parameters:
        array - Json array instance.
        Returns:
        List instance.
      • createObject

        public static java.lang.Object createObject​(com.google.gson.JsonElement element)
        Creates the object instance from a json element.
        Parameters:
        element - Json element.
        Returns:
        Object instance.
      • toJsonTree

        public static com.google.gson.JsonElement toJsonTree​(java.lang.Object object)