I came across some sample code with a generics notation I'm not familiar with:
vertx.eventBus().<JsonObject>consumer("sensor.updates", message -> {
JsonObject json = message.body();
...
});
Note the "<JsonObject>" before the call to consumer().
I understand what it does, that consumer() takes a generic type T and we're telling the compiler to expect a JsonObject in the second parameter. From the EventBus.consumer docs:
<T> MessageConsumer<T> consumer(String address, Handler<Message<T>> handler)
I guess I'm just surprised to see unfamiliar generics syntax after using it for many years. Is there a name for this notation, or any non-obvious behavior I need to be aware of?