io.swagger.client

## Class JSON

- java.lang.Object
- - io.swagger.client.JSON

-     public class JSON
      extends Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `JSON.ByteArrayAdapter` Gson TypeAdapter for Byte Array type
    `static class` | `JSON.DateTimeTypeAdapter` Gson TypeAdapter for Joda DateTime type
    `static class` | `JSON.DateTypeAdapter` Gson TypeAdapter for java.util.Date type If the dateFormat is null, ISO8601Utils will be used.
    `class` | `JSON.LocalDateTypeAdapter` Gson TypeAdapter for Joda LocalDate type
    `static class` | `JSON.SqlDateTypeAdapter` Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd" format will be used (more efficient than SimpleDateFormat).

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSON()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static com.google.gson.GsonBuilder` | `createGson()`
    `<T> T` | `deserialize(String body, Type returnType)` Deserialize the given JSON string to Java object.
    `com.google.gson.Gson` | `getGson()` Get Gson.
    `String` | `serialize(Object obj)` Serialize the given Java object into JSON string.
    `JSON` | `setDateFormat(DateFormat dateFormat)`
    `JSON` | `setDateTimeFormat(org.joda.time.format.DateTimeFormatter dateFormat)`
    `JSON` | `setGson(com.google.gson.Gson gson)` Set Gson.
    `JSON` | `setLenientOnJson(boolean lenientOnJson)`
    `JSON` | `setLocalDateFormat(org.joda.time.format.DateTimeFormatter dateFormat)`
    `JSON` | `setSqlDateFormat(DateFormat dateFormat)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 String serialize(Object obj)

      Serialize the given Java object into JSON string.
      Parameters:
        `obj` - Object
      Returns:
        String representation of the JSON

    - #### deserialize

          public <T> T deserialize(String body,
                                   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

    - #### setDateTimeFormat

          public JSON setDateTimeFormat(org.joda.time.format.DateTimeFormatter dateFormat)

    - #### setLocalDateFormat

          public JSON setLocalDateFormat(org.joda.time.format.DateTimeFormatter dateFormat)

    - #### setDateFormat

          public JSON setDateFormat(DateFormat dateFormat)

    - #### setSqlDateFormat

          public JSON setSqlDateFormat(DateFormat dateFormat)

Copyright © 2018. All rights reserved.