commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yang Diddy <>
Subject [beanutils]how can I use BeanUtils.populate to set value to my property with diff-argument type between setter and getter?
Date Thu, 27 Mar 2014 04:38:08 GMT
Please help:
if property of my class's setter and setter method arguments type doesn’t match, how can
i populate bean object?

public class Foo extends SomeClass{
private int id;

public Object getId() {
  return id;

public void setId(int id) { = id;

// testing
Foo foot = new Foo();
Map<String,Object> values = new HashMap<String,Object>();
BeanUtils.populate(foo, values);
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message