Class JSON


  • public class JSON
    extends java.lang.Object

    This class subject to change without prior notice, Please dont use this class directly.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  JSON.ByteArrayAdapter
      This class subject to change without prior notice, Please dont use this class directly.
      static class  JSON.DateTypeAdapter
      This class subject to change without prior notice, Please dont use this class directly.
      class  JSON.LocalDateTypeAdapter
      This class subject to change without prior notice, Please dont use this class directly.
      static class  JSON.OffsetDateTimeTypeAdapter
      This class subject to change without prior notice, Please dont use this class directly.
      static class  JSON.SqlDateTypeAdapter
      This class subject to change without prior notice, Please dont use this class directly.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSON()  
    • Constructor Detail

      • JSON

        public JSON()
    • Method Detail

      • createGson

        public static com.google.gson.GsonBuilder createGson()
      • getGson

        public com.google.gson.Gson getGson()
        Get Gson.
        Returns:
        Gson
      • setGson

        public JSON setGson​(com.google.gson.Gson gson)
        Set Gson.
        Parameters:
        gson - Gson
        Returns:
        JSON
      • setLenientOnJson

        public JSON setLenientOnJson​(boolean lenientOnJson)
      • serialize

        public java.lang.String serialize​(java.lang.Object obj)
        Serialize the given Java object into JSON string.
        Parameters:
        obj - Object
        Returns:
        String representation of the JSON
      • deserialize

        public <T> T deserialize​(java.lang.String body,
                                 java.lang.reflect.Type returnType)
        Deserialize the given JSON string to Java object.
        Type Parameters:
        T - Type
        Parameters:
        body - The JSON string
        returnType - The type to deserialize into
        Returns:
        The deserialized Java object
      • setOffsetDateTimeFormat

        public JSON setOffsetDateTimeFormat​(org.threeten.bp.format.DateTimeFormatter dateFormat)
      • setLocalDateFormat

        public JSON setLocalDateFormat​(org.threeten.bp.format.DateTimeFormatter dateFormat)
      • setDateFormat

        public JSON setDateFormat​(java.text.DateFormat dateFormat)
      • setSqlDateFormat

        public JSON setSqlDateFormat​(java.text.DateFormat dateFormat)