Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RestAdapter restAdapter = new RestAdapter.Builder()
- .setEndpoint(CallerInfo.API_URL)
- .setLogLevel(RestAdapter.LogLevel.FULL)
- .build();
- InGameInfo igi = restAdapter.create(InGameInfo.class);
- Game game = igi.fetchInGameInfo("EUW", "sasquatching");
- Log.d("Cancantest", "Game " + game); //Not null
- Log.d("Cancantest", "Team one " + game.getTeamOne()); //Null
- @SerializedName("teamTwo")
- @Expose private Team teamTwo;
- @SerializedName("teamOne")
- @Expose private Team teamOne;
- public void setTeamOne(Team teamOne) {
- this.teamOne = teamOne;
- }
- public void setTeamTwo(Team teamTwo) {
- this.teamTwo = teamTwo;
- }
- public Team getTeamOne() {
- return teamOne;
- }
- public Team getTeamTwo() {
- return teamTwo;
- }
- @SerializedName("array")
- @Expose private TeamMember[] teamMembers;
- public void setTeamMembers(TeamMember[] teamMembers) {
- this.teamMembers = teamMembers;
- }
- public TeamMember[] getTeamMembers() {
- return teamMembers;
- }
- {
- "game":{
- "teamTwo":{
- "array":[]
- },
- "teamOne":{
- "array":[]
- }
- }
- }
- public class Response {
- public final Game game;
- public Response(Game game) {
- this.game = game;
- }
- }
- String data = "...";
- Game game = gson.fromJson(data, Game.class)
- Response response = gson.from Json(data, Response.class)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement