I'd like to retrieve the actual class of the generic type that is found on an object's parametrized marker interface. Is this even possible?
The marker interface:
public interface MarkerInterface<T> {}
The method i'd like to have:
public class findClassForParametrizedMarkerInterface(MarkerInterface<T> markedObjectThatCouldExtendSomeRandomClass){
//How to retrieve the class T, or it's name?
}
For those wishing to know why I would like to do this: I have multiple dto jpa entities for some heavy jpa entities. I'd like to create a generic service that retrieves the correct full entity spring data jpa repository for the supplied dto. The dto's have a marker interface that specifies as parametrized generic type the full entity class.