mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 20:15:52 +01:00
merge + use the old search methods in the autocomplete feature
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user