two class:
public class BaseDo<K> {
protected K id;
public K getId() {
return id;
}
public void setId(K id) {
this.id = id;
}
}
public class BeanDo extends BaseDo<Integer> {
private String beanName;
public String getBeanName() {
return beanName;
}
public void setBeanName(String beanName) {
this.beanName = beanName;
}
}
I want use reflect to implment like this:
BeanDo beanDo = new BeanDo();
beanDo.setId("string here");
Integer type reference String type value.
BaseDo<String>?BeanDoand have the only thing he has as id is an string. Probably, because it use to be a int, but somebody thought it would be fun if they add an extra identifier in the string:12345-N( N for normal ) ... OMG I think I have been through this in the past ... :-S :-S