public class JSON extends Object
Modifier and Type | Class and Description |
---|---|
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 JSR310 LocalDate type
|
static class |
JSON.OffsetDateTimeTypeAdapter
Gson TypeAdapter for JSR310 OffsetDateTime 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 and Description |
---|
JSON() |
Modifier and Type | Method and Description |
---|---|
static com.google.gson.GsonBuilder |
createGson() |
com.google.gson.Gson |
getGson()
Get Gson.
|
JSON |
setDateFormat(DateFormat dateFormat) |
JSON |
setGson(com.google.gson.Gson gson)
Set Gson.
|
JSON |
setLocalDateFormat(DateTimeFormatter dateFormat) |
JSON |
setOffsetDateTimeFormat(DateTimeFormatter dateFormat) |
JSON |
setSqlDateFormat(DateFormat dateFormat) |
public static com.google.gson.GsonBuilder createGson()
public com.google.gson.Gson getGson()
public JSON setGson(com.google.gson.Gson gson)
gson
- Gsonpublic JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat)
public JSON setLocalDateFormat(DateTimeFormatter dateFormat)
public JSON setDateFormat(DateFormat dateFormat)
public JSON setSqlDateFormat(DateFormat dateFormat)
Copyright © 2018–2020 InfluxData, Inc.. All rights reserved.