@Test public void string() { final GsonSupport gsonSupport = new GsonSupport(); TypeLiteral<String> typeLiteral = new TypeLiteral<String>() { }; String json = "{\"metadata\":{\"occurred_at\":\"2016-09-20T21:52:00Z\",\"eid\":\"a2ab0b7c-ee58-48e5-b96a-d13bce73d857\",\"event_type\":\"et-1\",\"partition\":\"0\",\"received_at\":\"2016-10-26T20:54:41.300Z\",\"flow_id\":\"nP1I7tHXBwICOh5HqLnICOPh\"},\"data_op\":\"C\",\"data\":{\"id\":\"1\"},\"data_type\":\"et-1\"}"; gsonSupport.fromJson(json, String.class); gsonSupport.fromJson(json, typeLiteral.type()); }
@Override public <T> T fromJson(String raw, Class<T> c) { if (String.class.isAssignableFrom(c)) { return (T) raw; } return gson.fromJson(raw, c); }
GsonSupport implements JsonSupport { @Override public <T> T fromJson(String raw, Class<T> c) { if (String.class.isAssignableFrom(c)) { return (T) raw; } return gson.fromJson(raw, c); } }
GsonSupport implements JsonSupport { @Override public <T> T fromJson(String raw, Class<T> c) { if (String.class.isAssignableFrom(c)) { return (T) raw; } return gson.fromJson(raw, c); } GsonSupport(); }
GsonSupport implements JsonSupport { @Override public <T> T fromJson(String raw, Class<T> c) { if (String.class.isAssignableFrom(c)) { return (T) raw; } return gson.fromJson(raw, c); } GsonSupport(); static Gson gsonCompressed(); static Gson gson(); @Override String toJsonCompressed(Object o); @Override String toJson(Object o); @Override byte[] toJsonBytes(Object o); @Override byte[] toJsonBytesCompressed(Object o); @Override T fromJson(String raw, Class<T> c); T fromJson(String raw, Type tType); T fromJson(JsonObject jsonObject, Type tType); @Override T fromJson(Reader r, Class<T> c); @Override T fromJson(Reader r, Type tType); @Override Object transformEventRecord(EventRecord<T> eventRecord); @Override EventStreamBatch<T> marshalEventStreamBatch(String raw, Type type); }
GsonSupport implements JsonSupport { @Override public <T> T fromJson(String raw, Class<T> c) { if (String.class.isAssignableFrom(c)) { return (T) raw; } return gson.fromJson(raw, c); } GsonSupport(); static Gson gsonCompressed(); static Gson gson(); @Override String toJsonCompressed(Object o); @Override String toJson(Object o); @Override byte[] toJsonBytes(Object o); @Override byte[] toJsonBytesCompressed(Object o); @Override T fromJson(String raw, Class<T> c); T fromJson(String raw, Type tType); T fromJson(JsonObject jsonObject, Type tType); @Override T fromJson(Reader r, Class<T> c); @Override T fromJson(Reader r, Type tType); @Override Object transformEventRecord(EventRecord<T> eventRecord); @Override EventStreamBatch<T> marshalEventStreamBatch(String raw, Type type);  }