Skip to content

Instantly share code, notes, and snippets.

@gaboratorium
Created August 25, 2017 12:13
Show Gist options
  • Save gaboratorium/d4004c2200de1a87f2c1cc3f72a146a8 to your computer and use it in GitHub Desktop.
Save gaboratorium/d4004c2200de1a87f2c1cc3f72a146a8 to your computer and use it in GitHub Desktop.
Gson deserialization #java #gson #json
final String json = "{ username: 'Han Solo', password: 'jabbawockeez'}";
final Gson gson = new GsonBuilder().create();
final Person han = gson.fromJson(json, new TypeToken<Person>(){}.getType());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment