class NullNumberSerialize<T extends Number> extends TypeAdapter<T> {
    @Override
    public void write(JsonWriter out, T number) throws IOException {<FILL_FUNCTION_BODY>}

    @Override
    public T read(JsonReader jsonReader) throws IOException {
        return null;
    }
}

        if (number == null) {
            out.value(0);
        } else {
            out.value(number);
        }
    
<methods>public void <init>() ,public final T fromJson(java.io.Reader) throws java.io.IOException,public final T fromJson(java.lang.String) throws java.io.IOException,public final T fromJsonTree(com.google.gson.JsonElement) ,public final TypeAdapter<T> nullSafe() ,public abstract T read(com.google.gson.stream.JsonReader) throws java.io.IOException,public final java.lang.String toJson(T) ,public final void toJson(java.io.Writer, T) throws java.io.IOException,public final com.google.gson.JsonElement toJsonTree(T) ,public abstract void write(com.google.gson.stream.JsonWriter, T) throws java.io.IOException<variables>