@Test(expected = IllegalArgumentException.class) public final void testCreateFilterMalformed() { sut = new FindByAttributeQuery(); sut.getFilter("attrib745something"); }
public AbstractFilter getFilter(final String searchString) { int index = searchString.indexOf("="); if (index == -1) { throw new IllegalArgumentException("Malformed arg"); } AndFilter filter; filter = new AndFilter(); for (Filter filterObject : filterList) { filter.and(filterObject); } filter.and(new LikeFilter(searchString.substring(0, index), searchString.substring(index + 1, searchString .length()))); return filter; }
FindByAttributeQuery implements FilterCreator { public AbstractFilter getFilter(final String searchString) { int index = searchString.indexOf("="); if (index == -1) { throw new IllegalArgumentException("Malformed arg"); } AndFilter filter; filter = new AndFilter(); for (Filter filterObject : filterList) { filter.and(filterObject); } filter.and(new LikeFilter(searchString.substring(0, index), searchString.substring(index + 1, searchString .length()))); return filter; } }
FindByAttributeQuery implements FilterCreator { public AbstractFilter getFilter(final String searchString) { int index = searchString.indexOf("="); if (index == -1) { throw new IllegalArgumentException("Malformed arg"); } AndFilter filter; filter = new AndFilter(); for (Filter filterObject : filterList) { filter.and(filterObject); } filter.and(new LikeFilter(searchString.substring(0, index), searchString.substring(index + 1, searchString .length()))); return filter; } FindByAttributeQuery();  FindByAttributeQuery(final List<Filter> inFilterList); }
FindByAttributeQuery implements FilterCreator { public AbstractFilter getFilter(final String searchString) { int index = searchString.indexOf("="); if (index == -1) { throw new IllegalArgumentException("Malformed arg"); } AndFilter filter; filter = new AndFilter(); for (Filter filterObject : filterList) { filter.and(filterObject); } filter.and(new LikeFilter(searchString.substring(0, index), searchString.substring(index + 1, searchString .length()))); return filter; } FindByAttributeQuery();  FindByAttributeQuery(final List<Filter> inFilterList); AbstractFilter getFilter(final String searchString); }
FindByAttributeQuery implements FilterCreator { public AbstractFilter getFilter(final String searchString) { int index = searchString.indexOf("="); if (index == -1) { throw new IllegalArgumentException("Malformed arg"); } AndFilter filter; filter = new AndFilter(); for (Filter filterObject : filterList) { filter.and(filterObject); } filter.and(new LikeFilter(searchString.substring(0, index), searchString.substring(index + 1, searchString .length()))); return filter; } FindByAttributeQuery();  FindByAttributeQuery(final List<Filter> inFilterList); AbstractFilter getFilter(final String searchString);  }