I have this line of code:
messageProcessorFactory.getMessageProcessor(s.getEntry()).process(mapper.readValue(message, s.getEntry()));
With these definitions:
public<T extends BaseTopicEntry> AbstractMessageProcessor<T> getMessageProcessor(Class<T> entry)
...
private final Class<? extends BaseTopicEntry> entry;
...
public abstract class AbstractMessageProcessor<T extends BaseTopicEntry> {
public abstract void process(T message);
}
And mapper is Jackson's mapper.
private final ObjectMapper mapper = new ObjectMapper();
I get this error - why?
Error:(34, 95) java: incompatible types: inference variable T has incompatible bounds equality constraints: capture#1 of ? extends ro.billing.grecotopicconsumer.entity.BaseTopicEntry upper bounds: capture#2 of ? extends ro.billing.grecotopicconsumer.entity.BaseTopicEntry,java.lang.Object