Skip to content

Instantly share code, notes, and snippets.

@dvdfu
Created September 19, 2015 13:58
Show Gist options
  • Save dvdfu/3c37e1d3484b3a0e69d4 to your computer and use it in GitHub Desktop.
Save dvdfu/3c37e1d3484b3a0e69d4 to your computer and use it in GitHub Desktop.
package com.example.david.myapplication;
import com.google.gson.Gson;
import java.util.List;
/**
* Created by david on 15-09-19.
*/
public class DataWrapper {
public Data data;
public static DataWrapper fromJson(String s) {
return new Gson().fromJson(s, DataWrapper.class);
}
public String toString() {
return new Gson().toJson(this);
}
}
class Data {
public List<Translation> translations;
}
class Translation {
public String translatedText;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment