Hello I want to add a field in HashMap but I have an error
"java: incompatible types: inference variable T has incompatible bounds equality constraints: java.util.Map<java.lang.String,java.lang.Object>lower bounds: java.lang.Object" and I don't see why ?
metadataMap.put(review.getField(), metadataMap.get(review.getField()).stream()
.filter(suggestion -> review.getTerm() != null && review.getTerm().equals(suggestion.get(Constants.Review.TERM)))
.map(termInfo -> termInfo.put(Constants.STATUS, review.getStatus()))
.collect(Collectors.toList()));
Here is the other intel about my code
private void removeReviewFromSuggestionsOrDetails(ContainerModel container, ReviewModel review, String field, String instance)
throws ApiException {
Map<String, List<Map<String, Object>>> metadataMap = (Map<String, List<Map<String, Object>>>) container.get(field);
Should I use map there or something else? For add my new field Status
Map<String, List<Map<String, Object>>>
is the type you want to work with. – Hintham