@Test public void shouldSerializeGenericClass() { String expectedResult = "{\"genericWrapper\":{\"entityList\":[{\"name\":\"washington botelho\"},{\"name\":\"washington botelho\"}],\"total\":2}}"; Collection<Client> entityList = new ArrayList<Client>(); entityList.add(new Client("washington botelho")); entityList.add(new Client("washington botelho")); GenericWrapper<Client> wrapper = new GenericWrapper<Client>(entityList, entityList.size()); serialization.from(wrapper).include("entityList").serialize(); assertThat(result(), is(equalTo(expectedResult))); }
public <T> Serializer from(T object) { return from(object, null); }
GsonJSONSerialization implements JSONSerialization { public <T> Serializer from(T object) { return from(object, null); } }
GsonJSONSerialization implements JSONSerialization { public <T> Serializer from(T object) { return from(object, null); } GsonJSONSerialization(HttpServletResponse response, TypeNameExtractor extractor,
			ProxyInitializer initializer, VRaptorGsonBuilder builder, Serializee serializee); }
GsonJSONSerialization implements JSONSerialization { public <T> Serializer from(T object) { return from(object, null); } GsonJSONSerialization(HttpServletResponse response, TypeNameExtractor extractor,
			ProxyInitializer initializer, VRaptorGsonBuilder builder, Serializee serializee); boolean accepts(String format); Serializer from(T object); Serializer from(T object, String alias); NoRootSerialization withoutRoot(); JSONSerialization indented(); }
GsonJSONSerialization implements JSONSerialization { public <T> Serializer from(T object) { return from(object, null); } GsonJSONSerialization(HttpServletResponse response, TypeNameExtractor extractor,
			ProxyInitializer initializer, VRaptorGsonBuilder builder, Serializee serializee); boolean accepts(String format); Serializer from(T object); Serializer from(T object, String alias); NoRootSerialization withoutRoot(); JSONSerialization indented();  }