网址:
http ://www.xxx.com/getUser?userid=1&username=john&usersex=1
Java 类:
Class User{
private long userId;
private String userName;
private int userSex;
// get and set methods
...
//constructos
User(long userId, String userName, int userSex){
this.userId = userId;
this.userName = userName;
this.userSex = userSex;
}
}
如何将此 url 转换为 User 对象?对于此 url,我想获取 User user = new User(1,"john",1)。并且有任何 java 框架吗?