M
muthu.ramadoss
Folks,
Anyone know of any libraries that can autopopulate a pojo?
Ex:
I have a User object with first name and last name as members. I would
want to auto populate the object with some random values so the user
object can be used right away.
User user = new User ();
// Explicit member assignment
user.setFirstName ("John");
user.setLastName ("Doe");
// I need this
AutoPopulateLibrary.fill (user);
OR
user = AutoPopulateLibrary.fill (User.class);
I'll pass the user object or the class name or whatever and the target
object must be magically filled.
Can this be done already, or Am i missing something here?
Please comment.
Anyone know of any libraries that can autopopulate a pojo?
Ex:
I have a User object with first name and last name as members. I would
want to auto populate the object with some random values so the user
object can be used right away.
User user = new User ();
// Explicit member assignment
user.setFirstName ("John");
user.setLastName ("Doe");
// I need this
AutoPopulateLibrary.fill (user);
OR
user = AutoPopulateLibrary.fill (User.class);
I'll pass the user object or the class name or whatever and the target
object must be magically filled.
Can this be done already, or Am i missing something here?
Please comment.