예제 #1
0
  @Override
  public void onRegistered() {
    List<RecipeBook> books = RecipeBooks.getInstance().getBooksPartialMatch(getBookID());

    if (books.isEmpty()) {
      ErrorReporter.getInstance()
          .warning(
              "Flag "
                  + getFlagType()
                  + " could not find book ID containing '"
                  + bookID
                  + "', flag ignored.");
      remove();
      return;
    }

    RecipeBook book = books.get(0);

    if (books.size() > 1) {
      ErrorReporter.getInstance()
          .warning(
              "Flag "
                  + getFlagType()
                  + " found "
                  + books.size()
                  + " books matching ID '"
                  + bookID
                  + "', using first: "
                  + book.getTitle());
    }
  }