merge + use the old search methods in the autocomplete feature

This commit is contained in:
Mohamed Karray
2018-10-09 11:11:25 +02:00
28 changed files with 120 additions and 475 deletions

View File

@@ -237,16 +237,6 @@ public abstract class AbstractXmlDAO<I extends ModelObject,
return ImmutableList.copyOf(db.values());
}
@Override
public Collection<I> getFiltered(String searched, int limit) {
int size = db.values().size();
AssertUtil.assertIsNotEmpty(searched);
return ImmutableList.copyOf(db.values().stream()
.filter(item -> StringUtils.containsIgnoreCase(item.getId(), searched) || (item.getDisplayName() != null && StringUtils.containsIgnoreCase(item.getDisplayName() , searched)))
.limit(limit <= 0 ? size : limit)
.collect(Collectors.toList()));
}
/**
* Method description
*