Class JSON

java.lang.Object
org.openapitools.client.JSON

public class JSON extends Object
  • Field Details

  • Constructor Details

    • JSON

      public JSON()
  • Method Details

    • createGson

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

      private static String getDiscriminatorValue(com.google.gson.JsonElement readElement, String discriminatorField)
    • getClassByDiscriminator

      private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue)
      Returns the Java class that implements the OpenAPI schema for the specified discriminator value.
      Parameters:
      classByDiscriminatorValue - The map of discriminator values to Java classes.
      discriminatorValue - The value of the OpenAPI discriminator in the input data.
      Returns:
      The Java class that implements the OpenAPI schema
    • getGson

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

      public static void setGson(com.google.gson.Gson gson)
      Set Gson.
      Parameters:
      gson - Gson
    • setLenientOnJson

      public static void setLenientOnJson(boolean lenientOnJson)
    • serialize

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

      public static <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
    • setOffsetDateTimeFormat

      public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat)
    • setLocalDateFormat

      public static void setLocalDateFormat(DateTimeFormatter dateFormat)
    • setDateFormat

      public static void setDateFormat(DateFormat dateFormat)
    • setSqlDateFormat

      public static void setSqlDateFormat(DateFormat dateFormat)