diff --git a/README.md b/README.md index e6a0cb0..2a419bc 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Gson configuration and serializers/deserializers for Date/Time in [java.time.*]( ## Dependency :rocket: **Gradle** ```groovy -implementation "io.goodforgod:gson-configuration:1.4.0" +implementation "io.goodforgod:gson-configuration:1.4.1" ``` **Maven** @@ -19,7 +19,7 @@ implementation "io.goodforgod:gson-configuration:1.4.0" io.goodforgod gson-configuration - 1.4.0 + 1.4.1 ``` diff --git a/gradle.properties b/gradle.properties index 29820fd..ac2f5f4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ groupId=io.goodforgod artifactId=gson-configuration -artifactVersion=1.4.0 +artifactVersion=1.4.1 ##### GRADLE ##### diff --git a/src/main/java/io/goodforgod/gson/configuration/GsonFactory.java b/src/main/java/io/goodforgod/gson/configuration/GsonFactory.java index 7c92a4c..fa94039 100644 --- a/src/main/java/io/goodforgod/gson/configuration/GsonFactory.java +++ b/src/main/java/io/goodforgod/gson/configuration/GsonFactory.java @@ -1,6 +1,7 @@ package io.goodforgod.gson.configuration; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import java.io.InputStream; import java.util.Properties; @@ -23,26 +24,40 @@ public class GsonFactory { * @return Gson built with {@link GsonConfiguration#of()} as base */ public Gson build() { + return builder().create(); + } + + /** + * @return Gson built with {@link GsonConfiguration#of()} as base + */ + public GsonBuilder builder() { if (properties == null) this.properties = getProperties(); if (configuration == null) this.configuration = GsonConfiguration.ofProperties(properties); - return configuration.builder().create(); + return configuration.builder(); } /** * @return Gson built with {@link GsonConfiguration#ofJavaISO()} as base */ public Gson buildJavaISO() { + return builderJavaISO().create(); + } + + /** + * @return Gson built with {@link GsonConfiguration#ofJavaISO()} as base + */ + public GsonBuilder builderJavaISO() { if (properties == null) this.properties = getProperties(); if (configurationJavaISO == null) this.configurationJavaISO = GsonConfiguration.ofPropertiesJavaISO(properties); - return configurationJavaISO.builder().create(); + return configurationJavaISO.builder(); } private Properties getProperties() {