There is this function
Transformers.aliasToBean(RoomInfoDTO.class);
Now I would to use the above function in my generic method. How do I pass the class into the method and use it ?
I tried the following but it doesn't work
passThis(PurchaseHistoryDTO.class);
....
function passThis(Class<?> passedClass){
Transformers.aliasToBean(passedClass.getClass());
}
Somehow the function takes the class as class java.lang.Class.
getClass(), just pass theClass.passedClassis instance ofClasssogetClass()should returnclass java.lang.Class. Nothing abnormal here. Why do you callgetClass()on the first place?getClass()here? I already have Class that represents my type."getClass()because I assume it would be equivalent with.class. Anyway thank you guys for the explanation