Exemplo n.º 1
0
  public static <SM extends Map<String, Map<Long, URL>>> Pair<Long, URL> filterFromCategory(
      Map<String, SM> urls, String category, Long id) {
    SM services = urls.get(category);
    if (services == null) return null;

    for (Map.Entry<String, Map<Long, URL>> e1 : services.entrySet()) {
      Map<Long, URL> u = e1.getValue();
      if (u.containsKey(id)) return new Pair<Long, URL>(id, u.get(id));
    }
    return null;
  }