@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());
   }
 }