-
List<User> userList = new ArrayList<User>();
-
List<String> userNameList = (List<String>) CollectionUtils.collect(userList, new Transformer() {
-
-
public Object transform(Object o) {
-
User user = (User) o;
-
return user.getName();
-
}
-
});
-
List<Integer> list= (List<Integer>)CollectionUtils.collect(Arrays.asList(newsIds.split(",")),
-
new Transformer<String>() {
-
-
public Integer transform(String s) {
-
return Integer.parseInt(s);
-
}
-
});