@Override protected boolean match(Post msg) { if (msg.getName() != null && msg.getName().toLowerCase().indexOf(keyword) > -1) return true; if (msg.getCaption() != null && msg.getCaption().toLowerCase().indexOf(keyword) > -1) return true; if (msg.getDescription() != null && msg.getDescription().toLowerCase().indexOf(keyword) > -1) return true; if (msg.getMessage() != null && msg.getMessage().toLowerCase().indexOf(keyword) > -1) return true; return false; }
@Override public List<Comment> fetchCommentList(Post post) { List<Comment> postCommentList = new ArrayList<Comment>(); Connection<Comment> connection = facebookClient.fetchConnection(post.getId() + "/comments", Comment.class); for (List<Comment> page : connection) { for (Comment comment : page) { postCommentList.add(comment); } } return postCommentList; }
private void readFilteredPosts(List<Post> posts) { for (Post post : posts) { System.out.println(post.getMessage()); } }