It would make more sense to put the restriction on where the type T is used to parametrise the Class type. When you pass the type in, instead of using something like Class<?>, you should use Class<? extends T>.
This will only work (partly) if you have an object of type T. Then you can get the class of that object, see java.lang.Class<T> and find if it's the same as the object in question.
But note that this goes counter the very reason we have genrics: using a generic type is a way to say that you don't care what type it really is (up to upper and lower bounds that may be specified).
// Cast your object to the generic type.
T data = null;
try {
data = (T) obj;
} catch (ClassCastException cce) {
// Log the error.
}
// Check if the cast completed successfully.
if(data != null) {
// whatever....
}