@Test public void testGetTrimmer() { coreTest("{query:{},exclude:{ids:['A',1,{},2,3,[],[4,5],6,'7']}}", Arrays.asList(1L, 2L, 3L, 6L, 7L)); }
@Override public ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId) { try { JSONObject obj = inRequest.optJSONObject("exclude"); if (obj != null) { JSONArray array = obj.optJSONArray("ids"); if (array != null) { List<Long> ids = new ArrayList<Long>(); for (int i = 0; i < array.size(); i++) { long id = array.optLong(i, -1); if (id >= 0) { ids.add(id); } } if (!ids.isEmpty()) { return new ExcludeItemsTrimmer(ids); } } } } catch (Exception ex) { return nullTrimmer; } return nullTrimmer; }
ExcludeItemsTrimmerFactory implements ActivityQueryListTrimmerFactory { @Override public ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId) { try { JSONObject obj = inRequest.optJSONObject("exclude"); if (obj != null) { JSONArray array = obj.optJSONArray("ids"); if (array != null) { List<Long> ids = new ArrayList<Long>(); for (int i = 0; i < array.size(); i++) { long id = array.optLong(i, -1); if (id >= 0) { ids.add(id); } } if (!ids.isEmpty()) { return new ExcludeItemsTrimmer(ids); } } } } catch (Exception ex) { return nullTrimmer; } return nullTrimmer; } }
ExcludeItemsTrimmerFactory implements ActivityQueryListTrimmerFactory { @Override public ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId) { try { JSONObject obj = inRequest.optJSONObject("exclude"); if (obj != null) { JSONArray array = obj.optJSONArray("ids"); if (array != null) { List<Long> ids = new ArrayList<Long>(); for (int i = 0; i < array.size(); i++) { long id = array.optLong(i, -1); if (id >= 0) { ids.add(id); } } if (!ids.isEmpty()) { return new ExcludeItemsTrimmer(ids); } } } } catch (Exception ex) { return nullTrimmer; } return nullTrimmer; }  }
ExcludeItemsTrimmerFactory implements ActivityQueryListTrimmerFactory { @Override public ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId) { try { JSONObject obj = inRequest.optJSONObject("exclude"); if (obj != null) { JSONArray array = obj.optJSONArray("ids"); if (array != null) { List<Long> ids = new ArrayList<Long>(); for (int i = 0; i < array.size(); i++) { long id = array.optLong(i, -1); if (id >= 0) { ids.add(id); } } if (!ids.isEmpty()) { return new ExcludeItemsTrimmer(ids); } } } } catch (Exception ex) { return nullTrimmer; } return nullTrimmer; }  @Override ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId); }
ExcludeItemsTrimmerFactory implements ActivityQueryListTrimmerFactory { @Override public ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId) { try { JSONObject obj = inRequest.optJSONObject("exclude"); if (obj != null) { JSONArray array = obj.optJSONArray("ids"); if (array != null) { List<Long> ids = new ArrayList<Long>(); for (int i = 0; i < array.size(); i++) { long id = array.optLong(i, -1); if (id >= 0) { ids.add(id); } } if (!ids.isEmpty()) { return new ExcludeItemsTrimmer(ids); } } } } catch (Exception ex) { return nullTrimmer; } return nullTrimmer; }  @Override ListTrimmer getTrimmer(final JSONObject inRequest, final Long inUserEntityId);  }