Created
September 3, 2012 02:28
-
-
Save SimonGivre/3606322 to your computer and use it in GitHub Desktop.
Transform List of Bean into list of Bean's property values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.beanutils.BeanToPropertyValueTransformer; | |
import org.apache.commons.collections.CollectionUtils; | |
Collection<Long> userIds = (Collection<Long>) CollectionUtils.collect(users, new BeanToPropertyValueTransformer("id")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment