public List < Post > selectPosts ( final Collection < Long > postIds , final boolean withResolve ) throws SQLException { if ( postIds == null || postIds . size ( ) == 0 ) { return ImmutableList . of ( ) ; } Map < Long , Post > postMap = selectPostMap ( postIds , withResolve ) ; List < Post > posts = Lists . newArrayListWithExpectedSize ( postMap . size ( ) ) ; for ( long id : postIds ) { Post post = postMap . get ( id ) ; if ( post != null ) { posts . add ( post ) ; } } return posts ; }
Selects posts from a collection of ids into a list in input order .