I have to perform and() on my business objects that implement Predicate<MoneyOperation>.
Code where problem occurs is the line with and() call:
Predicate<? super MoneyOperation> predicate =
new MoneyOperationDateWithRadioButtonsPredicate(newv,
thisDayRdBtn.getValue(), date);
filteredData.setPredicate(filteredData.getPredicate().and(predicate));
Error:
The method and(Predicate<? super capture#14-of ? super MoneyOperation>)
in the type Predicate<capture#14-of ? super MoneyOperation> is not applicable
for the arguments (Predicate<capture#15-of ? super MoneyOperation>)
Although when I pass predicate to setPredicate() without calling and() compiler does not raise any errors.
MoneyOperationDateWithRadioButtonsPredicate class:
public class MoneyOperationDateWithRadioButtonsPredicate extends MoneyOperationFieldPredicate<LocalDate> { ... }
MoneyOperationFieldPredicate class:
public abstract class MoneyOperationFieldPredicate<T> implements Predicate<MoneyOperation> { ... }