I have a
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
The type of value is a list of strings:
List<String> valueList = map.get('key');
How can i search through this map (through all the valueLists within this map) and get all the values which startsWith 'xy' in a list back?
I hope the question is clear.
I have tried this, but no success:
map
.entrySet()
.stream()
.filter(e-> e.getValue().stream().filter(value -> value.startsWith(searchString)))
.collect(Collectors.toList());
I get this error: Stream cannot be converted to boolean