コード例 #1
0
 private List<PostMetadata> metadataForCategory(Category category) {
   return category
       .getPostsSet()
       .stream()
       .map(post -> post.getMetadata())
       .filter(md -> md != null)
       .collect(toList());
 }
コード例 #2
0
 private List<Wrap> postsForCategory(Category category) {
   return category != null
       ? new PostsPresentationBean(category.getPostsSet()).getVisiblePosts(NUM_POSTS)
       : emptyList();
 }