public interface Transformer<I, O> {
O transform(I var1);
}
class Test{
@Autowired
// The purpose of this transformer is to convert java object to
ion formatted string
private Transformer<Car,String> serialize;
public void fun(){
Car c = new Car();
c.setName("Audi");
String ion = serialize.transform(c);
}
}
Transformer interface is getting implemented by some class containing the logic for transformation . I need to know the class name of the generic params passed in while initialising the variable.