public String getDescription(String lang) { for (Lang l : descriptions) { if (l.getLang().equals(lang)) { return l.getContent(); } } if (descriptions.size() > 0) { return descriptions.get(0).getContent(); } return "No description set"; }
public String getContents(String lang) { for (Lang l : contents) { if (l.getLang().equals(lang)) { return l.getContent(); } } if (contents.size() > 0) { return contents.get(0).getContent(); } return "No content set"; }
public String getTitle(String lang) { for (Lang l : titles) { if (l.getLang().equals(lang)) { return l.getContent(); } } if (titles.size() > 0) { return titles.get(0).getContent(); } return "No title set"; }
public String getLocation(String lang) { for (Lang l : locations) { if (l.getLang().equals(lang)) { return l.getContent(); } } if (locations.size() > 0) { return locations.get(0).getContent(); } return "No location set"; }
public String getTitleJSONString() { JSONArray array = new JSONArray(); for (Lang l : titles) { JSONObject obj = new JSONObject(); try { obj.put(l.getLang(), l.getContent()); } catch (JSONException e) { e.printStackTrace(); } array.put(obj); } return array.toString(); }