diff --git a/java-client-generated/src/main/java/org/ergoplatform/explorer/client/ExplorerApiClient.java b/java-client-generated/src/main/java/org/ergoplatform/explorer/client/ExplorerApiClient.java index b43a37bd..d35104be 100755 --- a/java-client-generated/src/main/java/org/ergoplatform/explorer/client/ExplorerApiClient.java +++ b/java-client-generated/src/main/java/org/ergoplatform/explorer/client/ExplorerApiClient.java @@ -64,11 +64,6 @@ public ExplorerApiClient setDateFormat(DateFormat dateFormat) { return this; } - public ExplorerApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - public ExplorerApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; diff --git a/java-client-generated/src/main/java/org/ergoplatform/explorer/client/JSON.java b/java-client-generated/src/main/java/org/ergoplatform/explorer/client/JSON.java index 270072fd..03e7a1c9 100755 --- a/java-client-generated/src/main/java/org/ergoplatform/explorer/client/JSON.java +++ b/java-client-generated/src/main/java/org/ergoplatform/explorer/client/JSON.java @@ -41,7 +41,6 @@ public class JSON { private Gson gson; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); @@ -70,7 +69,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri public JSON() { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .create(); @@ -191,61 +189,6 @@ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } - /** - * 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). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() { - } - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - /** * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. @@ -309,9 +252,4 @@ public JSON setDateFormat(DateFormat dateFormat) { return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - return this; - } - } diff --git a/java-client-generated/src/main/java/org/ergoplatform/restapi/client/ApiClient.java b/java-client-generated/src/main/java/org/ergoplatform/restapi/client/ApiClient.java index 22014f0a..96ac8496 100755 --- a/java-client-generated/src/main/java/org/ergoplatform/restapi/client/ApiClient.java +++ b/java-client-generated/src/main/java/org/ergoplatform/restapi/client/ApiClient.java @@ -119,11 +119,6 @@ public ApiClient setDateFormat(DateFormat dateFormat) { return this; } - public ApiClient setSqlDateFormat(DateFormat dateFormat) { - this.json.setSqlDateFormat(dateFormat); - return this; - } - public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; diff --git a/java-client-generated/src/main/java/org/ergoplatform/restapi/client/JSON.java b/java-client-generated/src/main/java/org/ergoplatform/restapi/client/JSON.java index 4950af80..3fe93598 100755 --- a/java-client-generated/src/main/java/org/ergoplatform/restapi/client/JSON.java +++ b/java-client-generated/src/main/java/org/ergoplatform/restapi/client/JSON.java @@ -42,7 +42,6 @@ public class JSON { private Gson gson; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); @@ -136,7 +135,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri public JSON() { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) - .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) .create(); @@ -257,61 +255,6 @@ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } - /** - * 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). - */ - public static class SqlDateTypeAdapter extends TypeAdapter { - - private DateFormat dateFormat; - - public SqlDateTypeAdapter() { - } - - public SqlDateTypeAdapter(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - public void setFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - } - - @Override - public void write(JsonWriter out, java.sql.Date date) throws IOException { - if (date == null) { - out.nullValue(); - } else { - String value; - if (dateFormat != null) { - value = dateFormat.format(date); - } else { - value = date.toString(); - } - out.value(value); - } - } - - @Override - public java.sql.Date read(JsonReader in) throws IOException { - switch (in.peek()) { - case NULL: - in.nextNull(); - return null; - default: - String date = in.nextString(); - try { - if (dateFormat != null) { - return new java.sql.Date(dateFormat.parse(date).getTime()); - } - return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); - } catch (ParseException e) { - throw new JsonParseException(e); - } - } - } - } - /** * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. @@ -375,9 +318,4 @@ public JSON setDateFormat(DateFormat dateFormat) { return this; } - public JSON setSqlDateFormat(DateFormat dateFormat) { - sqlDateTypeAdapter.setFormat(dateFormat); - return this; - } - }