Expose serializeNulls with an accessor.

Useful for frameworks that build on Gson.
This commit is contained in:
jwilson 2015-09-07 22:31:43 -04:00
parent 2cac11b449
commit ff2c8f8e8b

View File

@ -246,6 +246,11 @@ public final class 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;