@Test public void testFilter() throws Exception { Assert.assertEquals("doubleProperty", filtered.get(0).getName()); Assert.assertEquals("booleanProperty", filtered.get(1).getName()); Assert.assertEquals("stringProperty", filtered.get(2).getName()); Assert.assertEquals("integerProperty", filtered.get(3).getName()); Assert.assertEquals("objectProperty", filtered.get(4).getName()); }
public List<Element> filter(List<Element> toFilter) throws FilterException { List<Element> remaining = new ArrayList<Element>(toFilter); List<Element> filtered = new ArrayList<Element>(); for (String name : names) { filtered.add(extractFieldByName(remaining, name)); } filtered.addAll(remaining); return filtered; }
ReorderFilter extends AbstractNameFilter implements ElementListFilter { public List<Element> filter(List<Element> toFilter) throws FilterException { List<Element> remaining = new ArrayList<Element>(toFilter); List<Element> filtered = new ArrayList<Element>(); for (String name : names) { filtered.add(extractFieldByName(remaining, name)); } filtered.addAll(remaining); return filtered; } }
ReorderFilter extends AbstractNameFilter implements ElementListFilter { public List<Element> filter(List<Element> toFilter) throws FilterException { List<Element> remaining = new ArrayList<Element>(toFilter); List<Element> filtered = new ArrayList<Element>(); for (String name : names) { filtered.add(extractFieldByName(remaining, name)); } filtered.addAll(remaining); return filtered; } ReorderFilter(String... names); }
ReorderFilter extends AbstractNameFilter implements ElementListFilter { public List<Element> filter(List<Element> toFilter) throws FilterException { List<Element> remaining = new ArrayList<Element>(toFilter); List<Element> filtered = new ArrayList<Element>(); for (String name : names) { filtered.add(extractFieldByName(remaining, name)); } filtered.addAll(remaining); return filtered; } ReorderFilter(String... names); List<Element> filter(List<Element> toFilter); String toString(); }
ReorderFilter extends AbstractNameFilter implements ElementListFilter { public List<Element> filter(List<Element> toFilter) throws FilterException { List<Element> remaining = new ArrayList<Element>(toFilter); List<Element> filtered = new ArrayList<Element>(); for (String name : names) { filtered.add(extractFieldByName(remaining, name)); } filtered.addAll(remaining); return filtered; } ReorderFilter(String... names); List<Element> filter(List<Element> toFilter); String toString();  }