This is the convention of creating a generic method.
The syntax for a generic method includes a type parameter, inside
angle brackets, and appears before the method's return type. For
static generic methods, the type parameter section must appear before
the method's return type.
If you see then before your return type String you defining your type parameter T. Now, coming to <T extends IEntity>, by this basically you are creating a bounded type parameter, where-in you are telling the compiler that T should only be a subclass of IEntity.
An important thing to note is that you need to define <T extends IEntity> before your method (this is what you call "generic method", more info coming...) because your interface is not a generic type, suppose your interface was like below then you need not to define the T type parameter because compiler would know what is the T type parameter.
public interface IUriMapper<T extends IEntity> {
String getUriBase(final Class<T> clazz);
}
So, basically generic method are useful (or in other words meant for situations) when you want to define your own type. Consider below example where-in your generic type (your interface "IUriMapper") defines type parameter "T" but for method getUriBase you are creating a new type "E"
public interface IUriMapper<T extends IEntity> {
<E extends Number> String getUriBase(final Class<E> clazz);
}
This Oracle documentation is best source to learn Generics.
String getUriBase(Class<? extends IEntity> clazz);.