Code example for GsonBuilder

Methods: createregisterTypeHierarchyAdapter

0
	public static Gson createGsonWithContentValuesAdapter(Class<?> clazz) {
		return createGsonWithContentValuesAdapter(new ContentValuesAdapter(clazz));
	} 
	 
	public static Gson createGsonWithContentValuesAdapter(ContentValuesAdapter contentValuesAdaper) {
		GsonBuilder gsonBuilder = new GsonBuilder();
		gsonBuilder.registerTypeHierarchyAdapter(ContentValues.class, contentValuesAdaper);
		return gsonBuilder.create();
	} 
	 
	@Override 
	public Result execute(DataSourceRequest dataSourceRequest, IDataSource dataSource, InputStream inputStream) throws Exception {
		InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
		BufferedReader bufferedReader = new BufferedReader(inputStreamReader, 8192);
		try { 
			return process(getGson(), bufferedReader);	
		} catch (JsonIOException exception){
            throw new IOException(exception);
        } finally { 
			IOUtils.close(inputStream);
Connect your IDE to all the code out there  Get Codota for Java