Created
April 25, 2017 10:01
-
-
Save avipars/1918f660b4d83ca5d3f7e417ad6f84f8 to your computer and use it in GitHub Desktop.
JSON Parser POJO Issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.snapr.app.opencv_test.Models; | |
import org.json.JSONException; | |
import org.json.JSONObject; | |
public class User { | |
//public ArrayList | |
<Item> | |
stl = new ArrayList | |
<Item> | |
(); | |
public String name ; | |
public String authId ; | |
public String id; | |
public Boolean connected; | |
public User() {} | |
public User(String name, String authId, String id, Boolean connected) { | |
super(); | |
this.name = name; | |
this.authId = authId; | |
this.id = id; | |
this.connected = connected; | |
} | |
public User(JSONObject obj){ | |
try { | |
this.authId = obj.getString("Id"); | |
// this.authId = obj.getJSONObject("Id").toString(); | |
this.name = obj.getString("UserName"); | |
this.connected = true; | |
} catch (JSONException e) { | |
e.printStackTrace(); | |
} | |
} | |
// public ArrayList | |
<Item> | |
getStl() { | |
// return stl; | |
// } | |
// | |
// public void setStl(ArrayList | |
<Item> | |
stl) { | |
// this.stl = stl; | |
// } | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public String getAuthId() { | |
return authId; | |
} | |
public void setAuthId(String authId) { | |
this.authId = authId; | |
} | |
public String getId() { | |
return id; | |
} | |
public void setId(String id) { | |
this.id = id; | |
} | |
public Boolean getConnected() { | |
return connected; | |
} | |
public void setConnected(Boolean connected) { | |
this.connected = connected; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment