Skip to content

Commit

Permalink
Expose serializeNulls with an accessor.
Browse files Browse the repository at this point in the history
Useful for frameworks that build on Gson.
  • Loading branch information
squarejesse committed Sep 8, 2015
1 parent 2cac11b commit ff2c8f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gson/src/main/java/com/google/gson/Gson.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ public Gson() {
this.factories = Collections.unmodifiableList(factories);
}

/** Returns true if this Gson instance writes fields with null values. */
public boolean serializeNulls() {
return serializeNulls;
}

private TypeAdapter<Number> doubleAdapter(boolean serializeSpecialFloatingPointValues) {
if (serializeSpecialFloatingPointValues) {
return TypeAdapters.DOUBLE;
Expand Down

0 comments on commit ff2c8f8

Please sign in to comment.