@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;
 }
예제 #2
0
  @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;
  }
예제 #3
0
 private void readFilteredPosts(List<Post> posts) {
   for (Post post : posts) {
     System.out.println(post.getMessage());
   }
 }