[New] Added ValueSearch.search(Stream)
This commit is contained in:
parent
68e06af486
commit
0b4e2e6e40
|
@ -21,9 +21,15 @@ public class ValueSearch<T> implements SearchPredicates {
|
||||||
* @return the search result
|
* @return the search result
|
||||||
*/
|
*/
|
||||||
public SearchResult<T> search(Collection<T> input) {
|
public SearchResult<T> search(Collection<T> input) {
|
||||||
|
return search(input.stream());
|
||||||
|
}
|
||||||
|
|
||||||
Stream<T> stream = input.stream();
|
/**
|
||||||
|
* Performs the actual search on the given input list
|
||||||
|
*
|
||||||
|
* @return the search result
|
||||||
|
*/
|
||||||
|
public SearchResult<T> search(Stream<T> stream) {
|
||||||
if (this.expression != null)
|
if (this.expression != null)
|
||||||
stream = stream.filter(e -> this.expression.matches(e));
|
stream = stream.filter(e -> this.expression.matches(e));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue