<@U0BLRBFMM> Yep, That is what lead me here. So pr...
# kotson
m
@salomonbrys Yep, That is what lead me here. So previously i had readers and writers like this
Copy code
@Override
        public CurrentData read(JsonReader jsonReader) throws IOException {
            CurrentData jsonCurrentData = null;

            if (jsonReader.peek() != JsonToken.NULL && jsonReader.peek() == JsonToken.BEGIN_OBJECT) {
                jsonCurrentData = new CurrentData();

                jsonReader.beginObject();

                while (jsonReader.hasNext()) {
                    String name = jsonReader.nextName();

                    if (jsonReader.peek() == JsonToken.NULL) {
                        jsonReader.skipValue();
                        continue;
                    }

                    switch (name) {
                        case "title":
                            jsonCurrentData.title = mStringAdapter.read(jsonReader);
                            break;
                        case "visualizationName":
                            jsonCurrentData.visualizationName = mStringAdapter.read(jsonReader);
                            break;
                        case "chartInfo":
                            jsonCurrentData.chartInfo = mChartInfoAdapter.read(jsonReader);
                            break;
                        default: {
                            jsonReader.skipValue();
                        }
                    }
                }

                jsonReader.endObject();
            }

            return jsonCurrentData;
        }

        @Override
        public void write(JsonWriter jsonWriter, CurrentData object) throws IOException {
            jsonWriter.beginObject();
            if ( object.title != null) {
                jsonWriter.name("title");
                mStringAdapter.write(jsonWriter, object.title);
            }

            if ( object.visualizationName != null) {
                jsonWriter.name("visualizationName");
                mStringAdapter.write(jsonWriter, object.visualizationName);
            }

            if ( object.chartInfo != null) {
                jsonWriter.name("chartInfo");
                mChartInfoAdapter.write(jsonWriter, object.chartInfo);
            }

            jsonWriter.endObject();
        }
    }