Skip to content

Instantly share code, notes, and snippets.

@kitplummer
Created April 15, 2009 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kitplummer/95911 to your computer and use it in GitHub Desktop.
Save kitplummer/95911 to your computer and use it in GitHub Desktop.
private List<NotificationFilter> processFiltersJson(String filters) {
List<NotificationFilter> fl = new ArrayList();
fl = Collections.EMPTY_LIST;
JSONArray ja = new JSONArray().fromObject(filters);
for (Iterator i = ja.iterator(); i.hasNext();) {
JSONObject jf = (JSONObject)i.next();
NotificationFilter nf = new NotificationFilter();
nf.setEmail(jf.getString("email"));
nf.setFilterTypeCode(jf.getString("filterTypeCode"));
nf.setFilterText(jf.getString("filterText"));
fl.add(nf);
}
return fl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment